http://jsfiddle.net/dude_jsfiddle/CQ9qm/
<ul>
<li class="jstree-leaf" kids="0" range="5-7" name="mars" public_id="mars_05" ra_depth="5">
</li>
<li class="jstree-leaf" kids="0" range="8-10" name="pluto" public_id="pluto_8" ra_depth="5"
</li>
</ul>
alert($(document).find("li[name='pluto','mars']").length);
谁知道如何获得这两个元素?
冥王星和火星一起找
答案 0 :(得分:3)
$(document).find("li[name='pluto'],li[name='mars']").length
答案 1 :(得分:0)
试试这个:
alert($(document).find("li[name='pluto'],li[name='mars']").length);