Html学习笔记3

来源:互联网 发布:淘宝类目007是什么牌子 编辑:程序博客网 时间:2024/05/01 18:28
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>mouse function</title>
    <script>
        function mouseDown(obj){//按下鼠标处理事件
            obj.style.background="#1ec5e5";
            obj.innerHTML="release you mouse";
        }
        function mouseUp(obj){//松开鼠标的处理事件
            obj.style.background="green";
            obj.innerHTML="press here"
        }
    </script>
</head>
<body>
<div style="background-color:green;
            width:200px;
            height:35px;
            margin:20px;
            padding-top:20px;
            color:rgb(255,255,255);
            font-weight:bold;
            font-size:18px;
            text-align:center;"
            onmousedown="mouseDown(this)"
            onmouseup="mouseUp(this)"
        >press here</div>
</body>
</html>
0 0
原创粉丝点击