answersLogoWhite

0

Here is the code:

<html>

<head>

<script type="text/javascript" langage="javascript">

function getHighest()

{

var a = parseInt(document.getElementById("num1").value);

var b = parseInt(document.getElementById("num2").value);

var c = parseInt(document.getElementById("num3").value);

if((a>b)&&(a>c))

{

alert(a+" is the highest number");

}

else if((b>a)&&(b>c))

{

alert(b+ " is the highest number");

}

else if((c>a)&&(c>b))

{

alert(c+ " is the highest number");

}

else

{

alert("One of them is not an int");

}

}

</script>

</head>

<body>

Input a: <input type="text" name="number1" id="num1" /><br />

Input b: <input type="text" name="number2" id="num2" /><br/>

Input c: <input type="text" name="number3" id="num3" /><br/>

Submit: <input type="submit" name="submit" value="submit" onclick="javascript:getHighest();return false;" />

</body>

</html>

User Avatar

Wiki User

∙ 14y ago

What else can I help you with?

Related Questions