Dynmically placing the input types inside(table) a <td> tag - innerHTML tag is not working in internet-explorer
I need to dynamically place input types inside a <td>
tag - innerHTML() method is not working in Internet Explorer. It works fine in Mozilla.
This is the way I'm plac开发者_如何学Going the input types in the JavaScript, where ValueCol is the <td>
id, On some action I have to change the control to text box.
document.getElementById("ValueCol").innerHTML = "<select name=\"type\" id=\"periodPass\" onchange=\"javascript:AmountOnPeriodPass(this);\"> <option selected=\"selected\" >Select a Pass</option><option>10-day Pass</option><option>Monthly Pass</option>";
It works fine in Mozilla but not in Internet Explore. What am I doing wrong?
Well, as described in QuirksMode Compatibility tables, innerHTML doesn't work fine in IE for the tables. You have to use the regular DOM manipulation.
It seems like you forgot to close the <select>
element. Perhaps that's of influence?
精彩评论