是否有一种使用CSS的方法:
hi
<div>
<p>
hello
</p>
<p>
world
</p>
</div>
baz
会这样呈现:
hi hello
world baz
然而,使用相同的CSS,则如下:
hi
<div>
<p>
hello world
</p>
</div>
baz
会像这样呈现吗?
hi hello world baz
和
hi
<div>
<p>
我用id来得到孩子,现在我改变了使用类。这样做,我发现的是,使用类不返回孩子。
工作代码
//Don't remove first element of select box with id 'someSelectBox'
$('#someSelectBox').children('option:not(:first)').remove();
不工作代码
//Don't remove first element of ALL select box with class 'selectBoxClass'
$(