Tema: label en js
Ver Mensaje Individual
  #5 (permalink)  
Antiguo 26/04/2011, 00:38
Avatar de schulz
schulz
 
Fecha de Ingreso: diciembre-2010
Ubicación: Santiago
Mensajes: 22
Antigüedad: 13 años, 4 meses
Puntos: 0
Respuesta: label en js

Cita:
Iniciado por masterojitos Ver Mensaje
oh verdad, es un label, disculpa en vez de value debe ser text....

es decir, cambia:
document.getElementById('lbluno').value = document.myform.select1.value;
por:
document.getElementById('lbluno').text = document.myform.select1.value;

Suerte
No se si tendre algun problema con mi pc lo probé en 2 navegadores y nada.

Código HTML:
<html>
<head>

</head>
<body>
<form name="myform">
<select name="select1">
  <option >uno</option>
  <option>dos</option>
  <option>tres</option>
</select>
<input name="btnuno" type="button" id="btnuno" value="boton" onclick="document.getElementById('lbluno').text=document.myform.select1.value;"/>

<label id="lbluno"></label>
</form>
</body>
</html>