C
Christopher Benson-Manica
I'm trying to dynamically change the contents of a select box by doing the
following...
function myfunc() {
var obj=document.getElementById("objname"); // name of the select box
var str='';
str+='<option>blah</option>';
obj.innerHTML=str;
alert(obj.innerHTML);
}
For reasons I don't understand, the alert gives me 'blah</option>'. Where is
the leading <option> tag?
following...
function myfunc() {
var obj=document.getElementById("objname"); // name of the select box
var str='';
str+='<option>blah</option>';
obj.innerHTML=str;
alert(obj.innerHTML);
}
For reasons I don't understand, the alert gives me 'blah</option>'. Where is
the leading <option> tag?