javascript - JS saying that form is not defined (FireFox 4.0) -


here code

<form name='logout' id="logout" action="/procommerce/index.php" method="post">         <input name="logmeout" type="hidden" value="1">     </form>     <script type="text/javascript">         $(document).bind('keydown', 'ctrl+shift+l', function(){             showdiv('logindiv');         });         $(document).bind('keydown', 'ctrl+shift+o', function(){             logout.submit();         });     </script> 

it works great in chrome , ie, in firefox : error: logout not defined source file: http://localhost/procommerce/index.php?action=home line: 416

what can do?

accessing dom element id directly global window object supported in ie, in firefox document.getelementbyid('logout').submit() or $('#logout').submit()


Comments