-6
如何使用每条语句获取子标签。如何使用每条语句获取子标签?
<svg id="svgcontent" >
<g id="layer" > <g>
<g id="test1" > <g>
<g id="test2"></g>
<g id="test2"> </g>
<svg>
我需要下面的输出如何使用jquery得到这个。
<g id="test1" > <g>
<g id="test2"></g>
<g id="test2"> </g>
我想这
var element = "";
$('#svgcontent g').each(function() {
var cur_class = $(this).attr("class");
if(cur_class != "layer") {
element = element+$(this).html();
}
}
哪里是你的jQuery代码? –