jeje justo iba a postear esa duda despues de hacer esto
Código:
function agrega(){
var lista=document.form1.uno;
var indice;
var opcion = document.createElement("option");
var contenido = document.createTextNode("dos");
opcion.appendChild(contenido);
lista.appendChild(opcion);
indice=optionUltimo();
alert("probando que se tiene el indice "+indice);
//lista.options[indice].value.selected
//lista.options[indice].selected
//lista.selectedIndex[indice]
//document.body.select.selectedIndex[indice].selected;
//document.body.select.selectedIndex[indice]
//lista.selected[indice]
//lista[indice].selected
}
function optionUltimo(){
var lista=document.form1.uno;
ultimo=(lista.length-1);
return ultimo;
}
y agregando el
Código:
document.form1.uno.selectedIndex=indice;
ya me funciona correctamente, muchas gracias a los dos
saludos