【发布时间】:2021-12-30 23:39:36
【问题描述】:
<html>
<head>
<title>Question</title>
<script type="text/javascript" >
function MouseOverHand(ID)
{
var Cursor='hand';
var ID=ID;
if (!document.all){ Cursor='pointer'; }
document.getElementById(ID).style.cursor=Cursor;
}
</script>
<script type="text/javascript" >
function MouseOverHelp(ID)
{
var Cursor='help';
var ID=ID;
if (!document.all){ Cursor='pointer'; }
document.getElementById(ID).style.cursor=Cursor;
}
</script>
</head>
<body>
<label id="Hand" onmouseover="MouseOverHand('Hand');" > Hand </label><br/><br/>
<label id="Help" onmouseover="MouseOverHelp('Help');" > Help </label>
</body>
</html>
上面的 html 用于将鼠标光标置于标签的鼠标上方。在这里,“手”和“帮助”光标在 Internet Explorer 中工作正常,但在 Firefox 和其他浏览器中不工作。
【问题讨论】:
-
我认为你的意思是将其标记为 javascript(不是 java)
-
嗯,在这种情况下确实不需要 JavaScript。我建议您使用 CSS 解决方案。
-
@mportiz08:是的,我已经重新标记了 OP。
标签: javascript html firefox mouse-cursor