<!DOCTYPE html>
<html>
<body>
<div
οnmοusedοwn="mDown(this)"
οnmοuseup="mUp(this)"
οnmοuseοver="mOver(this)"
οnmοuseοut="mOut(this)"
style="background-color:#D94A38;width:200px;height:50px;padding-top:25px;text-align:center;">
点击这里
</div>
<script>
function mDown(obj)
{
obj.style.backgroundColor="#1ec5e5";
obj.innerHTML="鼠标按下"
}
function mUp(obj)
{
obj.style.backgroundColor="#D94A38";
obj.innerHTML="鼠标松开"
}
function mOver(obj)
{
obj.innerHTML="鼠标在上面";
}
function mOut(obj)
{
obj.innerHTML="鼠标离开";
}
</script>
</body>
</html>
<html>
<body>
<div
οnmοusedοwn="mDown(this)"
οnmοuseup="mUp(this)"
οnmοuseοver="mOver(this)"
οnmοuseοut="mOut(this)"
style="background-color:#D94A38;width:200px;height:50px;padding-top:25px;text-align:center;">
点击这里
</div>
<script>
function mDown(obj)
{
obj.style.backgroundColor="#1ec5e5";
obj.innerHTML="鼠标按下"
}
function mUp(obj)
{
obj.style.backgroundColor="#D94A38";
obj.innerHTML="鼠标松开"
}
function mOver(obj)
{
obj.innerHTML="鼠标在上面";
}
function mOut(obj)
{
obj.innerHTML="鼠标离开";
}
</script>
</body>
</html>