使用外部js文件引用td标签
我正在尝试使用外部 Javascript 文件引用特定的 td id,但遇到了问题。我只是想创建一个简单的 mouseOver
事件,当用户将鼠标悬停在标记如下的表格中的图像上时,该事件将显示一些不同的内容:
<td id="lifeCalculatorButton">imagefoo</td>
在外部 Javascript 中,我会编写如下函数吗这个?:
function mouseOver(lifeCalculatorButton){
//some code
}
正如你所看到的,我总体上有点迷失......
I'm trying to reference a specific td id with an external Javascript file and am having trouble. I'm just trying to create a simple mouseOver
event that will display some different content when the user rolls over an image in a table that is labelled like this:
<td id="lifeCalculatorButton">imagefoo</td>
in the external Javascript would I write the function like this?:
function mouseOver(lifeCalculatorButton){
//some code
}
I'm a little lost overall as you can see...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
...应该有帮助;)
或者,你可以走奇怪的路线:
... should help ;)
Alternatively, you could go the quirky route:
使用 getElementById
编辑:稍微改变一下:P
use getElementById
EDIT: changed it a bit :P