I am trying to set dynamically innerHTML for value tag in IE.
The output I expect is this.
<input type="hidden" >a0FQ0000009rJfCMAU</input>
I tried innerHTML in IE but it was not working since it is supported for INPUT element. So, I tried the following out of desperation.
myElementId.setAttribute("value",textNodeId);
Unfortunately this is not what I want.
<input type="hidden" value="a0FQ0000009rJfCMAU">
Please advise.
If you check the
inputelement’s specification, you see that its Content Model should be empty. Thus, what you try to find is logically invalid HTML.See here.