Use Math.max to get the maximum value among three : max « Math « JavaScript Tutorial






<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
inp1 = 1;
inp2 = 2;
inp3 = 3;
document.write("The largest number entered was " + Math.max(inp1, inp2, inp3));

//  -->
</script>
</head>
<body>

</body>
</html>








9.17.max
9.17.1.Math.max()
9.17.2.Find the maximum number by using the Math.max
9.17.3.Finding the maximum and minimum number
9.17.4.Use Math.max to get the maximum value among three