jquery's append not working with svg element?

后端 未结 14 2178
北海茫月
北海茫月 2020-11-21 06:28

Assuming this:



 
 

        
14条回答
  •  死守一世寂寞
    2020-11-21 06:58

    If the string you need to append is SVG and you add the proper namespace, you can parse the string as XML and append to the parent.

    var xml = jQuery.parseXML('');
    $("svg").append(xml.documentElement))
    

提交回复
热议问题