【发布时间】:2013-02-09 10:40:10
【问题描述】:
有什么方法可以通过不使用 :hover 并且不在所有元素中添加“onmouseover 和 onmouseout”来做到这一点,就像在脚本中为所有输入元素设置 onmouseover 和 onmouseout 的有效方法一样。
注意:请先尝试 JavaScript,然后再尝试使用 JQuery
<head>
<title>123</title>
<style>
.button {
color: red;
}
.button:hover {
color: blue;
}
</style>
</head>
<body>
<div>
<input class="button" type="button" value="1">
<input class="button" type="button" value="2">
<input class="button" type="button" value="3">
</div>
</body>
【问题讨论】:
标签: javascript events hover