Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/12/2012, 17:05
djleonilo
 
Fecha de Ingreso: julio-2011
Mensajes: 88
Antigüedad: 12 años, 9 meses
Puntos: 2
Error NAN en este script

Hola amigos fijense que tengo este problema con mi script tengo que mostrar al cliente la cantidad de checkboxes que selecciono y lo hago con estre script pero me da error.

Código HTML:
<!DOCTYPE html>
<html lang="es">
	<head>
		<title></title>
		<script language="javascript" type="text/javascript">
			function suma(obj)
			{
				total=parseInt(document.getElementById("numero").value);
				if(obj.checked){
					total+=parseInt(obj.value);
				}else{
					total-=parseInt(obj.value);
				}
				document.getElementById("numero").innerHTML=text(total);
			}
		</script>
	</head>
	<body>
	<input type="checkbox" name="chck1" value="1" onChange="suma(this)"> 
	<input type="checkbox" name="chck2" value="1" onChange="suma(this)"> 
	<input type="checkbox" name="chck3" value="1" onChange="suma(this)">
	<hr>
	<h1 id="numero"></h1>
	
	</body>
</html>