I tried to assign a new value into the hidden input and checkbox of an input form. It’s working fine in Firefox but not in IE (I’m using IE 7). Does anyone know what is wrong with my code?
HTML:
<input type="hidden" id="msg" name="msg" value="" style="display:none"/>
<input type="checkbox" name="sp" value="100" id="sp_100">
Javascript:
var Msg="abc";
document.getElementById('msg').value = Msg;
document.getElementById('sp_100').checked = true;
Have a look at jQuery, a cross-browser library that will make your life a lot easier.