Hi there,
I'm trying to replace the options in a select but without luck, it works fine on FF but not on IE.
I think this is a very basic question but i cannot figure it out. I'm trying to use the innerHTML as I'm using AJAX to retrieve a response and the response is something like "<option value="modelA">Model A</option>", i even tried with following code but doesn't seems to work on IE, it just empties the select.
HTML Code:<select name="lbModel" class="big" id="lbModel"> <option value="0">Model</option> </select> <a href="javascript:replaceOptions()">Replace</a>Please can anyone help this newbie.Code://javascript function replaceOptions(){ var obj = document.getElementById("lbModel"); obj.innerHTML = '<option value="modelA">Model A</option>'; }



Reply With Quote
Bookmarks