开发者

Dynmically placing the input types inside(table) a <td> tag - innerHTML tag is not working in internet-explorer

开发者 https://www.devze.com 2022-12-09 11:50 出处:网络
I need to dynamically place input types inside a <td> tag - innerHTML() method is not working in Internet Explorer.It works fine in Mozilla.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消