这样可以吗?
来源:2-7 编程练习
葱的小呆毛
2019-06-15 21:02:06
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML事件</title>
</head>
<body>
<input type="button" value="开始" onmousemove="one(this)" onmouseout="three(this)">
<input type="button" value="结束" onmousemove="two(this)" onmouseout="four(this)">
<script type="text/javascript">
function one(btn){
btn.style.color="purple";
}
function two(btn2){
btn2.style.color="yellow";
}
function three(btn3){
btn3.style.color="gray";
}
function four(btn4){
btn4.style.color="gray";
}
</script>
</body>
</html>
1回答
你好同学,可以如下优化:

祝学习愉快 ,望采纳。
相似问题