jquery提取元素里的纯文本不包含span等里的内容

时间:2013-09-30    点击:81   
复制代码 代码如下:

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

nodeType
元素element 1
属性attr 2
文本text 3
注释comments 8
文档document 9
基于JQuery的列表拖动排序实现代码
javascript不可用的问题探究
js有序数组的连接问题
jquery更换文章内容与改变字体大小代码
jquery配合css简单实现返回顶部效果
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved