I have a HTML construction that resembles the following code:
<div id='intro'>
<svg>
//draw some svg elements
<svg>
</div>
I want to be able to add some elements to the SVG defined above using javascript and DOM. How would I accomplish that? I was thinking of
var svg1=document.getElementById('intro').getElementsByTagName('svg');
svg1[0].appendChild(element);//element like <line>, <circle>
I am not very familiar with using DOM, or how to create the element to be passed to appendChild so please help me out with this or perhaps show me what other alternatives I have to solve this issue. Thanks a lot.