Salve a tutti.
Il seguente codice gira bene sotto IE, ma restituisce errori se uso Mozilla..
function NuovoElemento(In, valore, testo)
{
if (document.getElementById)
{
var aSelect = document.getElementById(In);
}
else if (document.all)
{
var aSelect = document.all(In);
}
var newOption = document.createElement("OPTION");
aSelect.add(newOption);
newOption.value = valore;
newOption.text = testo;
}
Mozilla restituisce il seguente errore:
aSelect has no properties
La seguente stringa è la caussa del problema:
aSelect.add(newOption);
Se avete qualche consiglio..graz