Math.min() Method - Math Functions

Math.min() method of Math Functions in Javascript.
How to get the Lowest number in javascript?


Object: Math
Method: Math.min()
Description: To get the minimal or lowest number from the numbers listed. The below example will get the minimal or the lowest number from the entered numbers using math functions.


<script type="text/javascript">
function minnum()
var one=document.frm.num1.value;
var two=document.frm.num2.value;
alert('Minimum value is::'+ Math.min(one,two));
<form name=frm>
First Number :<input type="text" name="num1" size=10>
Second Number :<input type="text" name="num2" size=10>
<input type="button" value="Show Min number" onClick="minnum()">


First Number :
Second Number :

In the above example,
  • Two numbers are got a input using a form.
  • Math.min() method is used to get the lowest number out of the two.

Ask Questions

Ask Question