PDA

View Full Version : appendchild() IE vs Firefox



no1uknow
11-08-2005, 03:27 PM
I'm having an issue with IE and Firefox being compatible...

myEle.text is not being passed to IE but is to Firefox

myEle = document.createElement("select") ;
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[------- SELECT ITEM -------]" ;
controlToPopulate.appendChild(myEle)


Any ideas?

no1uknow
11-08-2005, 04:04 PM
OK I figured this out....

you have to createTextNode and do some appending...
Interesting...

myEle=document.createElement("option");
theText=document.createTextNode("[------- SELECT ITEM -------]");
myEle.appendChild(theText);
myEle.setAttribute("value","0");
controlToPopulate.appendChild(myEle);