admin管理员组文章数量:1391960
Below is my asp(HTML) code
<a id="More_Info" onclick ="window.top.location.href ='More_Info.asp?ussl=H&Start=<%=nRecCount%>&RS=<%=RecordStart%>;'" href="#">
from my javascript i wand to activate the onclick ="window.top.location.href ='More_Info.asp?ussl=H&Start=<%=nRecCount%>&RS=<%=RecordStart%>;'"
onclick event...
<script type="text/javascript" >
{
//here i wand to activate the click event
document.getElementById("More_Info").onclick // Something like this
}
</script>
Below is my asp(HTML) code
<a id="More_Info" onclick ="window.top.location.href ='More_Info.asp?ussl=H&Start=<%=nRecCount%>&RS=<%=RecordStart%>;'" href="#">
from my javascript i wand to activate the onclick ="window.top.location.href ='More_Info.asp?ussl=H&Start=<%=nRecCount%>&RS=<%=RecordStart%>;'"
onclick event...
<script type="text/javascript" >
{
//here i wand to activate the click event
document.getElementById("More_Info").onclick // Something like this
}
</script>
Share
Improve this question
edited Mar 4, 2010 at 14:56
Pointy
414k62 gold badges595 silver badges629 bronze badges
asked Mar 4, 2010 at 14:23
AlexAlex
1,9739 gold badges36 silver badges41 bronze badges
1 Answer
Reset to default 8This is a simplified version of a function I wrote for a similar question. You can find a list of the arguments to initMouseEvent
in the Mozilla Developer Center documentation but you shouldn't need to change anything.
function clickLink(link) {
if (document.createEvent) {
var event = document.createEvent("MouseEvents");
event.initMouseEvent("click", true, true, window,
0, 0, 0, 0, 0,
false, false, false, false,
0, null);
link.dispatchEvent(event);
}
else if (link.fireEvent) {
link.fireEvent("onclick");
}
}
本文标签: htmlhow to invoke click event from javascriptStack Overflow
版权声明:本文标题:html - how to invoke click event from javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744679460a2619311.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论