What is the correct way to hide an input text box? The following appears to work to work in all browsers except Internet Explorer. I am testing on IE8.
var field = document.getElementsByTagName("input")[0];
field.type = 'hidden';
For the record the following does not work:
var field = document.getElementsByTagName("input")[0];
field.style.display = 'none';
Neither does this work:
var field = document.getElementsByTagName("input")[0];
field.setAttribute("type", "hidden");