¿Cuánto medirá tu hijo? Calcúlalo según la altura de los padres

@import url('https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,400;0,700;0,800;1,400;1,700&display=swap'); .Rectngulo-211 { display: block; margin: 0 auto; max-width: 620px; padding: 25px; border-radius: 5px; border: solid 1px #00c5c3; background-color: #e8ffff; font-family: 'Merriweather Sans', sans-serif; color: #000000; text-align: left; } .Rectngulo-211 h1 { font-size: 32px; font-weight: 800; } .Rectngulo-211 p { font-size: 18px; line-height: 1.56; } .obligatorio { font-size: 10px !important; line-height: 2.4; } .form-altura { display: flex; flex-direction: column; justify-content: left; margin-left: 0 !important; } .genero-radio-container { margin-left: 0 !important; display: flex; flex-direction: row; padding: 22px 0px 0px 0px; } /* .Elipse-110, .Elipse-111 { width: 24px; height: 24px; margin: 0 8px 0 10px; border: solid 1px #17a2b8; background-color: #fff; cursor: pointer; } */ input[type=radio] { accent-color: #17a2b8; margin-right: 12px !important; } /*VIR STYLES*/ .hijo-label { position:relative; } /*.hijo-label::before{ content: ""; border: solid 1px #17a2b8 !important; border-radius: 50%; width: 25px; height: 25px; left: 10px; top: 28px; position: absolute; display: block; background-color: #fff; cursor:pointer } .hijo-label.checked::before{ background-color:#000 }*/ .radio input[type='radio'] { display: none; /*removes original button*/ } .radio label:before { /*styles outer circle*/ content: " "; display: inline-block; float: left; position: relative; margin: 0 5px 0 0; width: 24px; height: 24px; border-radius: 50%; border: 1px solid #17a2b8; background-color: #fff; cursor: pointer; } .radio.invalid-checkbox label:before{ border-color:#ff0000 } .radio label { position: relative; } .radio label input[type='radio']:checked+span { /*styles inside circle*/ border-radius: 50%; width: 16px; height: 16px; position: absolute; top: 5px; left: 5px; display: block; background-color: #17a2b8; } .hijo-label { cursor: pointer; margin-left: 10px; } .cm { font-weight: 400; } .altura-container label, .genero-radio-container label { font-size: 20px !important; font-weight: 700 !important; line-height: 1.2; float: left; padding: 22px 12px 0px 0px; } .genero-radio-container label{ padding: 0 12px 0px 0px; } .hijo { margin-right: 18px!important; } .altura { width: 76px; height: 38px; margin: 0px 12px 0 12px !important; border-radius: 5px; border: solid 1px #17a2b8 !important; background-color: white; font-family: 'Merriweather Sans', sans-serif; font-size: 16px; } .altura-container { margin-left: 0 !important; display: flex; flex-direction: column; justify-content: flex-start; padding-bottom: 32px; } .base { width: 88px; height: 32px; display: block; margin: 0 auto; border-radius: 5px; background-color: #00c5c3; border: none; cursor: pointer; } .Calcular { font-size: 16px; text-align: center; color: #fff; } .hide { display: none; } .Rectngulo-214 { max-width: 592px; margin: 31px 0 0; padding: 48px; border-radius: 5px; border: solid 1px #00c5c3; background-color: #00c5c3; font-size: 18px; font-weight: 700; color: #fff; text-align: center; } .invalid { border: 1px solid #dc3545 !important; accent-color: #dc3545; } .invalid-text { color: #dc3545; font-size: 10px; } @media screen and (max-width: 521px) { .Rectngulo-211 { max-width: 90%; padding: 12px!important; } .Rectngulo-211 h1 { font-size: 22px!important; } .Rectngulo-211 p { font-size: 14px!important; } .form-altura label { font-size: 16px!important; line-height: 1.5; } .hide { display: none; } .Rectngulo-214 { max-width: 100%; margin: 0 auto; margin-top: 22px; padding: 48px; font-size: 20px; } .hijo { margin-right: 0; } .genero-radio-container label { padding: 0px 12px 0px 0px!important; } .Elipse-110 { margin-left: -8px; } .altura { margin-top: 12px !important; margin-left: -6px; } .error { margin-top: 12px; } .radio label input[type='radio']:checked+span { width: 16px; height: 16px; top: 5px; left: 5px; } }

Calculadora de crecimiento según los padres

*Recuerda que todos los campos son obligatorios

¿Quieres saber cuánto medirá tu hijo de mayor? Con esta herramienta puedes calcular la altura que alcanzará en función de la altura de los padres. Esta calculadora utiliza la fórmula que los pediatras llaman “talla diana”: talla del padre + talla de la madre dividido entre 2 (+ 6,5 cm si es niño /- 6,5 cm si es niña). La altura final real del niño o la niña puede variar en +- 5 cm. La herencia genética no es el único factor que determina cuánto medimos de adultos: también influyen los hábitos de vida, las enfermedades, la alimentación y el entorno.

Tu hijo es:*
Por favor, indica la altura del padre Por favor, indica la altura de la madre
function isCheckboxCheckedFunc(){ let isCheckboxChecked=false; let checkbox = document.getElementsByName( "genero" ); for ( let i = 0; i { let isCheckboxChecked=isCheckboxCheckedFunc(); const result = document.getElementById('resultado'); if (!document.getElementById("alt-padre").value=="" && !document.getElementById("alt-madre").value=="" && isCheckboxChecked){ result.classList.remove('hide'); document.getElementById("alt-padre").classList.remove("invalid"); document.getElementById("alt-madre").classList.remove("invalid"); document.getElementById("nio").parentElement.parentElement.classList.remove("invalid-checkbox"); } } const calcularAltura = () => { let isCheckboxChecked=isCheckboxCheckedFunc(); let alturaPadre = document.getElementById("alt-padre").value; let alturaMadre = document.getElementById("alt-madre").value; /*VALIDATION*/ document.getElementById("alt-padre").classList.remove("invalid"); document.getElementById("alt-madre").classList.remove("invalid"); document.getElementById("nio").parentElement.parentElement.classList.remove("invalid-checkbox"); let errors=false; if (alturaPadre=="") { document.getElementById("alt-padre").classList.add("invalid"); console.log("error for the dad"); errors=true; } if (alturaMadre=="") { document.getElementById("alt-madre").classList.add("invalid"); console.log("error for the mom"); errors=true; } if (!isCheckboxChecked) { document.getElementById("nio").parentElement.parentElement.classList.add("invalid-checkbox"); console.log("error for the kid"); errors=true; } if(errors==true){ return; } /*END VALIDATION*/ let alturaPadresTotal=parseFloat(alturaPadre)+parseFloat(alturaMadre); console.log("altura padres total = " + alturaPadresTotal); let nuevoTotal; let alturaFinal; if (document.getElementById("nia").checked) { nuevoTotal = (alturaPadresTotal - 13) / 2; console.log("Restando 13 y dividiendo por 2 = " + nuevoTotal); alturaFinal = ((nuevoTotal + 7) + (nuevoTotal -7)) / 2; console.log("La media entre + 7 y -7 nos da el mismo resultado = " + alturaFinal); return document.getElementById("resultado").innerHTML = `Cuando sea mayor, tu hija podría medir ${alturaFinal} cm de altura.`; } else if (document.getElementById("nio").checked) { nuevoTotal = (alturaPadresTotal + 13) / 2; console.log("Sumando 13 y dividiendo por 2 = " +nuevoTotal); alturaFinal = ((nuevoTotal + 7) + (nuevoTotal - 7)) / 2; console.log("La media entre + 7 y -7 nos da el mismo resultado = " + alturaFinal); return document.getElementById("resultado").innerHTML = `Cuando sea mayor, tu hijo podría medir ${alturaFinal} cm de altura.`; } }