您的位置:首页 > 编程语言

获取屏蔽符号<!-- -->屏蔽的字符串的代码

2014-12-16 00:00 197 查看
摘要: Jquery

function getCommentText(elemId){
var text = $("#"+elemId).contents().filter(function(){
return this.nodeType == 8;
}).get(0).nodeValue;
return text;
}

//使用
var jsonText = getCommentText(elemId);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Jquery
相关文章推荐