Non ho tutti gli elementi cmq per aggiungere una option io farei cosė:
codice:
function NuovoElemento(idSelect, valore, testo)
{
var aSelect = document.getElementById(idSelect)
//var aSelect = document.volume[In];
var newOption = document.createElement("option");
//aSelect.add(newOption);
newOption.setAttribute('value', valore)
newOption.appendChild(document.createTextNode( testo ))
newOption.selected= true
aSelect.appendChild(newOption)
}
// OPPURE
function NuovoElemento(idSelect, valore, testo)
{
var aSelect = document.getElementById(idSelect)
var optLength = aSelect.options.length
aSelect.options[optLength] = (new Option(testo,valore))
aSelect.options[optLength].selected=true
}
Con FF non puoi associare un valore di un attributo direttamente ma devi usare setAttribute(). Mentre il testo non č un attributo ma un nodo.