JS 学习 20170711

这样可以

<div id="alf" onmouseover="document.getElementById('alf').style.width='200px';
document.getElementById('alf').style.height='200px';
document.getElementById('alf').style.background = 'green';" onmouseout="document.getElementById('alf').style.width='20px';
document.getElementById('alf').style.height='20px';
document.getElementById('alf').style.background = 'red';">

wo
</div>
//

<input type="checkbox" onmouseover="div1.style.display = 'block';" onmouseout="div1.style.display='none';"/>

这样不行。 不懂



<script>
function toGreen(){
document.getElementById("alf").style.width=300px;
document.getElementById("alf').style.height=300px;
document.getElementById("alf").style.background = green;

}

//
function callIt(a){
var element = document.getElementById("div1");
if(a==1){
element.style.display = "block";
}else{
element.style.display = "none";
}

}
</script>

<input type="checkbox" onmouseover="callIt(1)" onmouseout="callIt(0)"/>
//
<div id="alf" onmouseover="toGreen()" onmouseout="toGreen()">wo
</div>



sublime 解决 中文 乱码

逐个 调文件, woqu

在Sublime Text 中,File-->Save with Encoding-->UTF-8 with BOM

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容