javascript appedChild()和document.createTextNode
时间:2014-10-18 09:52:06
收藏:0
阅读:338
appendChild只能直接增加html元素标签,不能直接添加字符串元素。增加字符串必须配合document.createTextNode
实例:
td.appendChild(a);
td.appendChild(document.createTextNode(‘Paid: (‘ + method.toUpperCase() + ‘)’));
appendChild 添加的是容器,
document.createTextNode 添加的是文本
原文:http://my.oschina.net/guomingliang/blog/334836
评论(0)