Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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..??

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
200 views
Welcome To Ask or Share your Answers For Others

1 Answer

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>..."


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...