javascript onmousedown、onmouseup练习代码


<html>
<meta charset="UTF-8">
<head>
head>
<body>
<div id="mouse" style="background-color: #33cccc;width: 200px;height: 200px;"
     onmousedown='over(this)' onmouseup='out(this)'>请把鼠标按下去div>

<script>
    function over(obj) {
      
        obj.innerHTML = "松开鼠标";
    }
    function out(obj) {
      
        obj.innerHTML = "按下鼠标";
    }
script>
body>
html>

你可能感兴趣的:(JavaScript,javascript)