= parseFloat(document.getElementById('altura_m_imc').value); var altura_cm = parseFloat(document.getElementById('altura_cm_imc').value); var altura = (altura_m * 100 + altura_cm)/100; var imc = peso/(altura*altura); if(isNaN(imc)) { alert('use apenas numeros para suas medidas'); return false; } imc = Math.round(imc*100)/100; alert('Seu IMC: ' + imc); } addEvent_imc(window, 'load', addListeners_imc, false);</script><form id="imc"> <table width="131" align="center" height="128" border="0" cellpadding="3" cellspacing="1" style="font-size:11px;font-family: arial;background-color:#000000;align=center"> <tr> <th height="22" colspan="2" style="background-color:#66cc99;color:#000;text-align:center;">Calculadora de IMC</th> </tr> <tr> <td height="26" style="background-color:#ccffcc">Peso:</td> <td style="background-color:#ccffcc"><input type="text" id="peso_imc" style="font-size:11px;font-family:arial;width:25px" /> kg</td> </tr> <tr> <td height="26" style="background-color:#ccffcc">Altura:</td> <td style="background-color:#ccffcc" nowrap="nowrap"> <input type="text" id="altura_m_imc" style="font-size:11px;font-family:arial;width:25px" /> m <input type="text" id="altura_cm_imc" style="font-size:11px;font-family:arial;width:25px" /> cm </td> </tr> <tr> <td height="30" colspan="2" align="center" style="background-color:#ccffcc"> <input type="button" value="calcular" id="calcula_btn_imc" style="font-size: 11px;font-family: arial;" /></td> </tr> <tr> <td colspan="2" style="font-size:10px;background-color:#007236;" align="right"><a href="http://www.anutricionista.com/" target="_blank" style="color:#000;">Nutricionista</a></td> </tr> </table></form> <script type="text/javascript">function addEvent_imc(elm, evType, fn, useCapture){// cross-browser event handling by Scott Andrew if(elm.addEventListener){ elm.addEventListener(evType, fn, useCapture); return true; } else if(elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r; } else { elm['on' + evType] = fn; }}function addListeners_imc(e){ if(!document.getElementById) return; var calcula_btn = document.getElementById('calcula_btn_imc'); addEvent_imc(calcula_btn, 'click', imc, false);}function imc(e){ var peso = parseFloat(document.getElementById('peso_imc').value); var altura_m = parseFloat(document.getElementById('altura_m_imc').value); var altura_cm = parseFloat(document.getElementById('altura_cm_imc').value); var altura = (altura_m * 100 + altura_cm)/100; var imc = peso/(altura*altura); if(isNaN(imc)) { alert('use apenas numeros para suas medidas'); return false; } imc = Math.round(imc*100)/100; alert('Seu IMC: ' + imc); } addEvent_imc(window, 'load', addListeners_imc, false);</script><form id="imc"> <table width="131" align="center" height="128" border="0" cellpadding="3" cellspacing="1" style="font-size:11px;font-family: arial;background-color:#000000;align=center"> <tr> <th height="22" colspan="2" style="background-color:#66cc99;color:#000;text-align:center;">Calculadora de IMC</th> </tr> <tr> <td height="26" style="background-color:#ccffcc">Peso:</td> <td style="background-color:#ccffcc"><input type="text" id="peso_imc" style="font-size:11px;font-family:arial;width:25px" /> kg</td> </tr> <tr> <td height="26" style="background-color:#ccffcc">Altura:</td> <td style="background-color:#ccffcc" nowrap="nowrap"> <input type="text" id="altura_m_imc" style="font-size:11px;font-family:arial;width:25px" /> m <input type="text" id="altura_cm_imc" style="font-size:11px;font-family:arial;width:25px" /> cm </td> </tr> <tr> <td height="30" colspan="2" align="center" style="background-color:#ccffcc"> <input type="button" value="calcular" id="calcula_btn_imc" style="font-size: 11px;font-family: arial;" /></td> </tr> <tr> <td colspan="2" style="font-size:10px;background-color:#007236;" align="right"><a href="http://www.anutricionista.com/" target="_blank" style="color:#000;">Nutricionista</a></td> </tr> </table></form> <script type="text/javascript">function addEvent_imc(elm, evType, fn, useCapture){// cross-browser event handling by Scott Andrew if(elm.addEventListener){ elm.addEventListener(evType, fn, useCapture); return true; } else if(elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r; } else { elm['on' + evType] = fn; }}function addListeners_imc(e){ if(!document.getElementById) return; var calcula_btn = document.getElementById('calcula_btn_imc'); addEvent_imc(calcula_btn, 'click', imc, false);}function imc(e){ var peso = parseFloat(document.getElementById('peso_imc').value); var altura_m = parseFloat(document.getElementById('altura_m_imc').value); var altura_cm = parseFloat(document.getElementById('altura_cm_imc').value); var altura = (altura_m * 100 + altura_cm)/100; var imc = peso/(altura*altura); if(isNaN(imc)) { alert('use apenas numeros para suas medidas'); return false; } imc = Math.round(imc*100)/100; alert('Seu IMC: ' + imc); } addEvent_imc(window, 'load', addListeners_imc, false);</script><form id="imc"> <table width="131" align="center" height="128" border="0" cellpadding="3" cellspacing="1" style="font-size:11px;font-family: arial;background-color:#000000;align=center"> <tr> <th height="22" colspan="2" style="background-color:#66cc99;color:#000;text-align:center;">Calculadora de IMC</th> </tr> <tr> <td height="26" style="background-color:#ccffcc">Peso:</td> <td style="background-color:#ccffcc"><input type="text" id="peso_imc" style="font-size:11px;font-family:arial;width:25px" /> kg</td> </tr> <tr> <td height="26" style="background-color:#ccffcc">Altura:</td> <td style="background-color:#ccffcc" nowrap="nowrap"> <input type="text" id="altura_m_imc" style="font-size:11px;font-family:arial;width:25px" /> m <input type="text" id="altura_cm_imc" style="font-size:11px;font-family:arial;width:25px" /> cm </td> </tr> <tr> <td height="30" colspan="2" align="center" style="background-color:#ccffcc"> <input type="button" value="calcular" id="calcula_btn_imc" style="font-size: 11px;font-family: arial;" /></td> </tr> <tr> <td colspan="2" style="font-size:10px;background-color:#007236;" align="right"><a href="http://www.anutricionista.com/" target="_blank" style="color:#000;">Nutricionista</a></td> </tr> </table></form>