document.getElementById("ctrl").disabled = true;
this works in IE but does not work in mozila. What am I doing?
Have you tried:
document.getElementById("ctrl").setAttribute('disabled', true);
<body> <input id="btnSubmit" type="button" value="submit" onclick="disabled(this);"/> <script> function disabled(ctrl) { ctrl.disabled = true; } </script> </body>
It is hard to say what the problem is that you have. mozilla do anything when code is running? Is an error displayed? What version of ie have you checked this with? And can you also provide html for the ctrl element?
ctrl
One of the problems with IE and the getElementById method is that in some versions of the browser it will match the id attribute of the tag, as well as the name attribute (which does not follow the JavaScript specification ). In Mozilla, it only matches the id attribute.
getElementById
id
name