有关javascript 里的Math的使用.
2014-07-29 21:10
295 查看
<!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> <title>Untitled Page</title> <script type="text/javascript"> ///计算三角函数的的 function resule() { var longBorder = new Number(document.getElementById("longBorder").value); var shortBorder = new Number(document.getElementById("shortBorder").value); var resuleConValue = new Number(); resuleConValue = Math.atan2(shortBorder, longBorder); angle = resuleConValue * (180 / Math.PI); document.getElementById("resultCon").value = angle } </script> </head> <body> <p> 长边:<input type="text" id="longBorder" /> </p> <p> 短边:<input type="text" id="shortBorder" /> </p> <p> 结果:<input type="text" id="resultCon" /> </p> <input type="button" value="计算" onclick="resule();" /> </body> </html>document.getElementById("longBorder").value
才是获取文本框里面的值..
而document.getElementById("longBorder")
是获取值里的对象.
相关文章推荐
- 有关javascript 里的Math的使用.
- javascript对象之内置对象Math使用方法
- JavaScript Math.ceil() 函数使用介绍
- 浅谈JavaScript中的Math.atan()方法的使用
- 简介JavaScript中Math.cos()余弦方法的使用
- JavaScript中使用指数方法Math.exp()的简介
- 有关javascript模态窗口的使用
- 在JavaScript中使用对数Math.log()方法的教程
- JavaScript中的Math.SQRT1_2属性使用简介
- 介绍JavaScript中Math.abs()方法的使用
- JavaScript中使用指数方法Math.exp()的简介
- Javascript 找一组数字中的最大数的方法(附使用Math.max来检测浏览器支持哪个属性)
- Javascript四舍五入Math.round()与Math.pow()使用介绍
- Javascript四舍五入Math.round()与Math.pow()使用介绍
- JavaScript中的Math.SQRT1_2属性使用简介
- javascript中Math.random()使用详解
- javascript对象之内置对象Math使用方法
- 有关javascript中的JSON.parse和JSON.stringify的使用一二
- 在JavaScript中使用对数Math.log()方法的教程
- JavaScript中使用Math.floor()方法对数字取整