I just found out that in FF, if you are dynamically creating an OPTION DOM element inside a SELECT element and just set its innerHTML, it sets both the innerHTML i.e. the displayed text as well as the value of the OPTION.
var opt = document.createElement(‘OPTION’);
opt.innerHTML = ‘Opt’;
this set the “value” attribute as well of the element.
Is this correct behavior? I haven’t been able to replicate this for IE.
innerHTML is not well defined here.
https://developer.mozilla.org/En/DOM/Element.innerHTML
you may use something like the following code for adding option elements to a select element: