I set className property of a dinamically generated select control with the following code:
oField.className ="select";
It works for Firefox not for Internet Explorer. How can I set this property on IE?
The code:
var oField = document.createElement("select");
if(browser == "IE"){
oField.size = 1;
oField.setAttribute("name","sele"+num);
oField.onChange = function(){
AggiungiRiga(oField.name,oField.value)
};
}
else{
oField.setAttribute("size",1);
oField.setAttribute("name","sele"+num);
oField.setAttribute("onChange","AggiungiRiga(this.name,this.value)");
}
oField.className ="select";
Here I add it to the document:
oTd1.appendChild(oField);
(oTd1
is the <td>
element where the select control must be place). I know the code is not of good quality cause is legacy code.