亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

setAttribute都能設定什么屬性

if(text=="") ? ?{ ? ? Lists[i].setAttribute("color","red"); ? ?document.write(Lists[i].getAttribute("color")+"
"); ? ?} ?} setAttribute具體都能規定哪些屬性呢,color和font這種為什么不行

正在回答

2 回答

因為html標簽不支持 color 屬性,如果需要設置樣式請使用

?element.style.color?=?'red'


0 回復 有任何疑惑可以回復我~
?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可以去看看


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

setAttribute都能設定什么屬性

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號