通过鼠标事件改变元素的某种状态

来源:互联网 发布:常见的颜色恒常性算法 编辑:程序博客网 时间:2024/05/12 01:58

<html>
    <head>
        <title>Style Example</title>
    </head>
    <body>
       <p>Move your mouse over the square.</p>
        <div id="div1"
             style="background-color: red; height: 50px; width: 50px"
             onmouseover="this.style.backgroundColor = 'blue'"
             onmouseout="this.style.backgroundColor = 'red'"></div>
    </body>
</html>

原创粉丝点击