jquery's append not working with svg element?

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

Assuming this:



 
 

        
14条回答
  •  误落风尘
    2020-11-21 06:48

    This is working for me today with FF 57:

    function () {
        // JQuery, today, doesn't play well with adding SVG elements - tricks required
        $(selector_to_node_in_svg_doc).parent().prepend($(this).clone().text("Your"));
        $(selector_to_node_in_svg_doc).text("New").attr("x", "340").text("New")
            .attr('stroke', 'blue').attr("style", "text-decoration: line-through");
    }
    

    Makes:

提交回复
热议问题