Need Guidance for displaying text inside a circle

I want to display dynamic text inside a circle to make it appear as a node. The circle should contain two texts inside it, one above the other . Two nodes should be connected by a link and a dynamic text has to be entered on the link. I am using simple javascript to proceed with this. Anyone having ideas how can this be done better using javascript itself?