This is my jquery:
$(document).ready(function(){
$(myForm.elements).hide();
}
This is how form looks in html :
<form name="myForm"></form>
Running this in Firefox , will throw an error : myForm is not defined
But, this code will run successfully in Chrome and Opera. How to resolve this error in Firefox?
You could use
document.forms[0]instead but if you have several forms on your page that might not be the best solution.I would use a selector instead of an object
or
The :input selector “Selects all input, textarea, select and button elements.”