1
对于该HTML替换具有非textnode兄弟姐妹
<标签 ID = “nameWrapper” > <输入 类型= “复选框” 名称= “名称” />旅客< /标记的textnode >
什么是用其他文本代替guest
的最短javascript代码?我能想到的是,
$('#nameWrapper').contents().filter(function() {
return this.nodeType == 3;
}).replaceWith('other text');
1具有更好的解决方案:) – alex 2010-12-09 03:36:19