您的位置:首页 > Web前端 > JavaScript

javascript入门· javascript math对象演示

2007-11-27 14:31 435 查看
在上节string对象上我瞎扯了几句math的数学函数,希望没有吓倒你哦,呵呵,其实我们要用的很少了,一般那些什么切,什么弦我们是不用的,所以我也没有打算演示哦,这里我们把常用的几个作下!

演示一:对比大小

演示二:计算值的N次方

演示三: 四舍五入取值 (值是整数哈)

演示四:生成0-88之间的随机数字

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>javascript math对象演示</title>

</script>

</head>

<body>

<p>在上节string对象上我瞎扯了几句math的数学函数,希望没有吓倒你哦,呵呵,其实我们要用的很少了,一般那些什么切,什么弦我们是不用的,所以我也没有打算演示哦,这里我们把常用的几个作下!</p>

<p><strong>演示一:对比大小</strong></p>

<form id="form1" name="form1" onsubmit="return false">

<input type="text" name="one" />

<input type="text" name="two" />

<input type="submit" name="Submit" value="提交" onclick="mx(this.form)" />

</form>

<p><strong>演示二:计算值的N次方</strong></p>

<form id="form2" name="form2" onsubmit="return false">

<input type="text" name="one" />

<input type="text" name="two" />

<input type="submit" name="Submit2" value="提交" onclick="pw(this.form)" />

</form>

<p><strong>演示三: 四舍五入取值 </strong>(值是整数哈)</p>

<form id="form2" name="form2" onsubmit="return false">

<input type="text" name="one" />

<input type="submit" name="Submit2" value="提交" onclick="Round(this.form)" />

</form>

</p>

<p><strong>演示四:生成0-88之间的随机数字</strong></p>

<form id="form3" name="form3" onsubmit="return false">

<input type="submit" name="Submit3" value="提交" onclick="rdm(this.form)" />

</form>

<p> </p>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: