Onevent handler not fired in Mozilla
I use this method for navigation. It works fine in IE but the event does not get fired in Firefox. What is wrong here?
<img id="prev" src="images/prev.jpg" width="79" height="22" alt="Previous" onclick="setAct(2)" />
<script type="text/javascript" language="javascript">
//<![CDATA[
function 开发者_运维问答setAct(a){
frm.act.value=a;
frm.submit();
}
//]]>
</script>
You might want to try:
function setAct(a) {
document.getElementById('act').value = a;
document.getElementById('frm').submit();
}
Also take care that the arguments to getElementById are same as the id in your HTML tags for the respective elements.
精彩评论