Setting innerHtml selection window in IE

There is a situation on my website where I need to add a new <// option> for a specific selection field. I do the following:

1. Make an ajax request that returns parameter tags, for example

 <option>one</option>

 <option>two</option>

and etc.,

2. Set the internal html of the specific selection window

 document.getElementById("id").innerHTML=response;

it works well in firefox / chrome but not in IE ....

any known solution for this.?

+3
source share
2 answers

This is a known IE bug. You can either use the DOM methods to add / replace option elements, or use the workarounds suggested by Microsoft , one of which is select in the div and set the innerHTML div to "<select> <option> ..."

+4
source

http://support.microsoft.com/kb/276228

IE. , , options.innerHTML . Microsoft , . div.innerHTML .

 <div id ="IEFix">
 <select name="TOR" id="TOR">

</select>
</div>


var x ='<select name="TOR" id="TOR">\n';    
x +='<option value="MVR Only(FTE)">MVR Only(FTE)</option>\n';
    x += '</select>\n';
    IEFix.innerHTML = x;
0

All Articles