开发者

Onevent handler not fired in Mozilla

开发者 https://www.devze.com 2023-03-03 22:00 出处:网络
I use this method for navigation. It works fine in IE but the event does not get fired in Firefox. What is wrong here?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消