Jump to content
Fórum Script Brasil
  • 0

Erro besta, mas to apanhando


murilo563

Question

Bom pessoal, estou começando a aprender a usar o javascript, mas to apanhando nesse código. Me ajudem ae!

<html>

<head>

<title>IMC</title>

&lt;script type="text/javascript">

function calculoimc() {

var formulario = window.document.getElementById("formulario");

var metro = parseInt(formulario.txtmetros.value);

var centimetro = parseInt(formulario.txtcm.value);

var altura = (metro*100 + centimetro)/100;

alert ('testando');

</script>

</head>

<body>

<form method="post" action="" id="formulario">

Cálculo de IMC = p/a*a<br/>

Kilos:<input name="txtkilos" type="text" /><br/>

Metros:<input name="txtmetros" type="text" /><br/>

CM:<input name="txtcm" type="text" /><br/>

IMC:<input name="txtimc" type="text" disabled="disabled" />

</form>

<a href="#" onclick="calculoimc();">Calcular</a>

</body>

</html>

Era para aparecer um pop-up quando eu clicar no link calcular, mas não aparece nada, nem usando o chrome e muito menos o explorer, e não é problema de que o navegador está bloqueando o javascript, não sei o que fazer, me ajudem plz

vlws

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...