Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
Seleccione el valor del elemento con los botones de radio

 function cittaBox() { var selezione = Document.getElementById("selector"); var selezioneTxt = selezione.options[selezione.selectedIndex].text; Document.getElementById("txtBox").value=selezioneTxt;}
 <SELECT NAME="citta" id="selector" onchange="cittaBox()"> <OPTION value="Roma"> Roma </OPTION> <OPTION value="Milano"> Milano </OPTION> <OPTION value="Torino"> Torino </OPTION> <OPTION value="Napoli"> Napoli </OPTION> <OPTION value="Bari"> Bari </OPTION> <OPTION value="Taranto"> Taranto </OPTION> <OPTION value="Lecce"> Lecce </OPTION> </SELECT> </P> <P align= "center" id="selezione0"> <INPUT type="text" name="citta" size="40" id="txtBox"> </P>

¿Alguna idea de por qué no funciona?

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

javascript distingue entre mayúsculas y minúsculas Usar documento en lugar de Documento aparte de eso, no hay problema con su código

 function cittaBox() { var selezione = document.getElementById("selector"); var selezioneTxt = selezione.options[selezione.selectedIndex].text; document.getElementById("txtBox").value=selezioneTxt; }

espero te respondan..

about 4 years ago · Juan Pablo Isaza Denunciar

0

reemplace Document.getElementById por document.getElementById

about 4 years ago · Juan Pablo Isaza Denunciar

0

Tu código se ve bien. Pero solo tienes un error. Cambiar documento to documento`. Minúsculas. Entonces funciona.

 function cittaBox() { console.log(1) var selezione = document.getElementById("selector"); var selezioneTxt = selezione.options[selezione.selectedIndex].text; document.getElementById("txtBox").value=selezioneTxt; }
 <SELECT NAME="citta" id="selector" onchange="cittaBox()"> <OPTION value="Roma"> Roma </OPTION> <OPTION value="Milano"> Milano </OPTION> <OPTION value="Torino"> Torino </OPTION> <OPTION value="Napoli"> Napoli </OPTION> <OPTION value="Bari"> Bari </OPTION> <OPTION value="Taranto"> Taranto </OPTION> <OPTION value="Lecce"> Lecce </OPTION> </SELECT> </P> <P align= "center" id="selezione0"> <INPUT type="text" name="citta" size="40" id="txtBox"> </P>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda