已采纳回答 / 康振宁
txt.setAttribute('style','color:blue');这个是设置颜色innerHTML不是元素的属性,是DOM的操作,貌似不能用setAttribute
2015-01-29