欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery提取元素里的純文本不包含span等里的內容

 更新時間:2013年09月30日 16:17:27   作者:  
如何實現(xiàn)提取元素里的純文本,不包含span等里的內容,這就是本文要為大家介紹的重點,你將學會使用jquery來實現(xiàn)
復制代碼 代碼如下:

var text = '';
$('div').contents().each(function(){
if(this.nodeType === 3){
text += this.wholeText;
}
});

nodeType
元素element 1
屬性attr 2
文本text 3
注釋comments 8
文檔document 9

相關文章

最新評論