Hola, tengo el siguiente código el cual falla, alguien puede decirme porque:
<html>
<head>
<title>Ejemplo Radio Button</title>
<script>
function cambiaColor(){
var i
alert("cuantos = " + document.fcolores.colorin.length);
for (i=0;i<document.fcolores.colorin.length;i++){
if (document.fcolores.colorin[i].checked)
break;
}
document.bgColor = document.fcolores.colorin[i].value
}
</script>
</head>
<body>
<form name=fcolores>
<input type="Radio" name="colorin" value="ffffff" checked> Blanco
<br>
<br>
<input type="Button" name="" value="Cambia Color" onclick="cambiaColor()">
</form>
</body>
</html>
Si hay más de un input type=radio no falla, porque falla cuando solo hay uno.
Un saludo.