欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JavaScript使用Math.Min返回兩個數(shù)中較小數(shù)的方法

 更新時間:2015年04月06日 11:39:32   作者:feige  
這篇文章主要介紹了JavaScript使用Math.Min返回兩個數(shù)中較小數(shù)的方法,涉及javascript中Math.Min方法的使用技巧,非常具有實(shí)用價值,需要的朋友可以參考下

本文實(shí)例講述了JavaScript使用Math.Min返回兩個數(shù)中較小數(shù)的方法。分享給大家供大家參考。具體如下:

下面JavaScript通過Math.Min返回兩個數(shù)中較小的那個

<!DOCTYPE html>
<html>
<body>
<p id="demo">
Click the button to return the lowest number of 5 and 10.
</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
document.getElementById("demo").innerHTML=Math.min(5,10);
}
</script>
</body>
</html>

運(yùn)行上面代碼得到數(shù)字為5

希望本文所述對大家的javascript程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論