<script > ? ? ? ?window.onload=function () { ? ? ? ? ? ?var e=document.getElementsByTagName("input")[0].value;? ? ? ? ? ? ?var b=document.getElementsByTagName("input")[1].value; ? ? ? ? ? ?var c=document.getElementsByTagName("button"); ? ? ? ? ? ?var d=document.getElementById("div1"); ? ? ? ? ? c[0].onclick=function () { ? ? ? ? ? d.style.e="b";//為什么這樣改不了樣式 ? ? ? ? ? ?} ? ? ? ?} ? ?</script></head><body><div id="outer"> ? ?<p><label>屬性名:</label><input type="text" value="background" /></p> ? ?<p><label>屬性值:</label><input type="text" value="blue" /></p> ? ?<p><label></label><button>確定</button><button>重置</button></p></div><div id="div1">在上方輸入框輸入"屬性名"及"屬性值",點(diǎn)擊確定按鈕查看效果。</div></body></html>
菜鳥(niǎo)下午敲代碼遇到的問(wèn)題,為什么改不了樣式
qq_T毛_0
2017-05-20 17:12:12