qq_慕用2129022
2019-03-27 10:38
请问鼠标经过变颜色的代码怎么写啊
之前教程不就是有吗,先获取对应id,然后通过 style修改样式,最后在 要经过的地方 onmouseover 事件
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> 鼠标经过事件 </title>
<script type="text/javascript">
function message(){
var mycolor = document.getElementById("psw");
mycolor.style.color = "red";
}
</script>
</head>
<body>
<form>
<p id = "psw">密码</P>:<input name="password" type="password" >
<input name="确定" type="button" value="确定" onmouseover = "message()"/>
</form>
</body>
</html>
求具体代码参考
onmouseover,用他解决
JavaScript进阶篇
467403 学习 · 21877 问题
相似问题