老师有简单的方法吗
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>jsDOM事件练习</title>
</head>
<body>
<input type="button" value="开始" id="s" onmousemove="start(this)" onmouseout="m(this)">
<input type="button" value="结束" id="e" onmousemove="end(this)" onmouseout="m(this)">
<script type="text/javascript">
function start(){
s.style.color="yellow";
}
function end(){
e.style.color="red";
}
function m(){
s.style.color="gray";
e.style.color="gray";
}
</script>
</body>
</html>8
收起
正在回答
1回答
虽然你做的颜色不对,但是实现方法操作是对的,这个操作本来就很简单,你做的也是最简的了,继续加油!欢迎采纳。
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星