提交按钮 mousedown 事件
我有一个关于带有提交按钮的鼠标按下图像交换的问题。这是提交按钮代码:
<input src="submit.png" type="image" class="submit" id="submit">
我尝试使用通常用于 mousedown 图像交换的内容添加一个事件,
onmousedown="MM_swapImage('Image1','','submit_down.png',1)" onmouseup="MM_swapImgRestore()"/>
但我不能在 mousedown 代码中使用提交的 id,因为我认为它与按钮而不是图像相关联。
谢谢,
卢克
I had a question regarding a mousedown image swap with a submit button. here is the submit button code:
<input src="submit.png" type="image" class="submit" id="submit">
I tried to add an event using what I normally use for mousedown image swaps,
onmousedown="MM_swapImage('Image1','','submit_down.png',1)" onmouseup="MM_swapImgRestore()"/>
But I can't use the id of submit in the mousedown code, because I think it's associated with the button rather than an image.
Thanks,
Luke
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你真正想做的是稍微改变你的提交按钮。通常您会有
name="submit"
,如果您更改为该名称,您应该能够将 id 更改为您想要的任何内容。这不起作用的唯一原因是,如果您使用 id 属性来对其他地方的某些 js onmousedown 执行某些操作?I think what you really want to do here is change your submit button a bit. Usually you would have
name="submit"
, if you changed to that, you should be able to change the id to anything you want. The only reason this wouldn't work is if your using the id attribute in order to do something with some js onmousedown somewhere else?