是否可以选择不在另一个嵌套标签内的标签的值?jquery选择器 - 选择不在另一个嵌套标签内的值
例如,在下面的代码中,我想从$('#example')获得'Text I want to select'文本。
<td id="example">
<a> Text I don't want to select</a>
<span> Other text I don't want to select</span>
Text I want to select
<anyOtherTag> Other text I don't want to select</anyOtherTag>
</td>
谢谢。
jQuery没有帮助功能。这是一个关于这个问题的好主意(我如何选择带有jQuery的文本节点)。 http://stackoverflow.com/questions/298750/how-do-i-select-text-nodes-with-jquery – 2010-12-15 19:04:56