This is my code:
<input id="input_with_id" type="text" value="hello" disabled>
<script type="text/javascript">
input_with_id = {type:"checkbox", value:"bye", disabled:false}
</script>
IE 8 shows me this error message: "This object does not manage this property or this method". But if I use this code, it works like it should:
<script type="text/javascript">
var my_var = new Object();
my_var = {a:"x", b:"y", c:"z"}
</script>
The only difference between these two codes is that in I'm trying to reassign a DOM element to a Javascript object which has the same structure as a DOM element and in the other one I'm reassigning a Javascript object to another Javascript object. Why can't you treat the DOM element like a Javascript object here although normally they work similarly?