On my website there is a situation where I need to append new < //option> tags to a specific selection box. I am doing the following:
1.Make an ajax request which returns option tags like
<option>one</option>
<option>two</option>
etc.,
2.Set the inner html of a specific selection box by
document.getElementById("id").innerHTML=response;
it works well in firefox/chrome but not in IE….
any known solution for this..??
It’s a known IE bug. You can either user DOM methods to append/replace the option elements, or you can use the workarounds suggested by Microsoft, one of which is to wrap your select in a div and set the div’s innerHTML to “<select><option>…”