Hello!
I'm trying to create <option> tags dynamically. These get filled with content from an xml file --I know this part works. Its the creation of the actual <option> tags thats a problem. It does work on Firefox but on IE 7 it only gives me a long dropdown with no text values.
BTW, I'm using jQuery as well, although I don't think that matters.
Method 1:
Code:
var optn = document.createElement("option");
optn.innerHTML = $("name", this).text();
optn.value = $("id", this).text();
$("select#SchoolID").append(optn);
Method 2:
Code:
var optn = document.createElement("option");
optn.text = $("name", this).text();
optn.value = $("id", this).text();
$("select#SchoolID").append(optn);
Method 2:
Code:
var thetxt = $("name", this).text();
var thevalue = $("id", this).text();
var newoption = new Option(thetxt,thevalue, false);
$("select#SchoolID").append(newoption);
Thanks in advance!