Possible Duplicate:
How do I select text nodes with jQuery?
在 jquery 中我们可以使用以下方法选择一个元素:
$(#elem).get();
他们是使用 jquery 选择元素的所有文本节点的方法吗?
最佳答案
试试这个,
$('#elem *').contents().filter(function() {
return (this.nodeType == 3);
});
关于javascript - 使用jquery获取所有文本节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14233808/