How do I use javascript to clone an SVG element?

前端 未结 3 602
孤街浪徒
孤街浪徒 2020-12-31 20:11

I am trying to follow the example here under the cloneNode section (fourth occurrence of \'cloneNode\' in the document). The document says it\'s a DRAFT so i\'m wondering i

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 20:55

    When you call getElementById, the element doesn't yet exist. Put the script at the end of the body :

    
    
    
        

提交回复
热议问题