<!doctype html><html><head><meta charset="utf-8"><title>javascript</title><style> *margin{margin: 0px;padding: 0px;float: left;} .div1{ width: 400px; height: 400px; background: red; } </style><script> var x=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight; y=document.getElementById("div1"); y.innerHTML="瀏覽器的高度為"+x+"."; function towidth(){ var oDiv=document.getElementById("div1"); oDiv.style.width=600 px; } function turn(name,value){ var odiv=document.getElementById('div1'); odiv.style[name]=value; } </script></head><body><input type="button" value="變寬" onclick="towidth()"/><input type="button" value="變高" onclick="turn('height','600px')"/><input type="button" value="變綠" onclick="turn('color','green')"/><div class="div1"></div></body></html>
javascript為什么加載不了,各種操作無效,求大佬
慕俠1089519
2017-07-17 17:26:56