电脑技术学习

用鼠标感应来改变某个按钮的CSS属性

dn001
<!-- 把如下代码加入<body>区域中 -->
<input type="button" value="移过来试试" style="border:1 black solid;background:#f4f4f4" onmouseover="tst(this,'red','#ffffff')" onmouseout="tst(this,'black','#f4f4f4')">
<script>
function tst(obj0,obj1,obj2){
obj0.style.border="1 "+obj1+" solid";
obj0.style.background=obj2;
}
</script>