aaaa
This commit is contained in:
22
teaching/wanzhaoyi/js/jisuanqi.html
Normal file
22
teaching/wanzhaoyi/js/jisuanqi.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script>
|
||||
function add(){
|
||||
var num=document.getElementsByClassName("num")
|
||||
console.log(num[0].value,'+',num[1].value)
|
||||
console.log(Number(num[0].value)+Number(num[1].value))
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input type="text" value="" class="num">
|
||||
<input type="text" value="" class="num"><br/>
|
||||
|
||||
<button onclick="add()">加</button>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user