js函数入门
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
//函数是具有一定功能的代码块
function fn(){
//功能就是弹出四次10
alert("10")
alert("10")
alert("10")
alert("10")
alert("10")
alert("10")
alert("10")
}
// fn()
function fn2(){
var a = prompt("数字1")
var b = prompt("数字2")
alert(Number(a)-Number(b))
}
fn2()
fn2()
fn2()
</script>
</body>
</html>
js前端变量入门