js_math_confirm_prompt

<!DOCTYPE html>
<html lang="en">
<head>
<title>Title</title>
<meta charset="UTF-8">
<!--&lt;!&ndash; <script src="js_file01.js"></script>&ndash;&gt; 尽量放后body前边-->
</head>
<body>

<script>


// alert(Math.random()); // 0 - 1
// alert(Math.round(2.6)); // 四舍五入
// alert(Math.pow(2,3)); // 次方

// alert(2**3);

// var ret=confirm("您确定保存吗?"); // confirm: 有true和false的返回值
// alert(ret);
// if (ret){
// xx
// }else if(xx){
//
// }

var ret=prompt("请输入内容:"); // prompt也有返回值,可输入文本
alert(ret);

</script>

</body>
</html>
posted @ 2020-08-02 22:21  zxy_ang  阅读(109)  评论(0)    收藏  举报