setAttribute都能設定什么屬性
if(text=="")
? ?{
? ? Lists[i].setAttribute("color","red");
? ?document.write(Lists[i].getAttribute("color")+"
");
? ?}
?}
setAttribute具體都能規定哪些屬性呢,color和font這種為什么不行
if(text=="")
? ?{
? ? Lists[i].setAttribute("color","red");
? ?document.write(Lists[i].getAttribute("color")+"
");
? ?}
?}
setAttribute具體都能規定哪些屬性呢,color和font這種為什么不行
2016-11-20
舉報
2016-11-20
因為html標簽不支持 color 屬性,如果需要設置樣式請使用
2016-11-24
?if(text=="") ????{ ????Lists[i].setAttribute("title","<font?color='red'?size='5'?face='verdana'>WEB前端技術</font>"); ????//<font></font>標簽兼容性可能沒那么好 ????document.write(Lists[i].getAttribute("title")+"<br>"); ????} ????//可以用<font></font>設置輸出內容的樣式,只是可能不是全兼容吧!w3school上不建議用,但能用也不錯 ????//http://www.w3school.com.cn/tags/tag_font.asp可以去看看