JavaScript createElementNS and SVG

前端 未结 4 1637
轻奢々
轻奢々 2020-11-28 09:56

I want to create inline SVG graphics using Javascript.

However, it seems like createElementNS function applies some normalization and transforms all tags

4条回答
  •  情歌与酒
    2020-11-28 10:19

    the answer given is too extensive and not really useful to me and i find it to much troublesome or to simply say bogus. If i were you, i would simple have on element in html with tag say:

    
    

    and when i have to create element or add information i would simply do:

    document.getElementById('myElement').innerHTML = 'your stuff here'; 
    

    I Hope that was helpful.

提交回复
热议问题