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>