您的位置:首页 > Web前端 > HTML

Html学习笔记3

2015-09-08 20:50 429 查看
<!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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: