-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path22.html
33 lines (30 loc) · 961 Bytes
/
22.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(function(){
// var btn1 = document.getElementById('btn1');
// var btn2 = document.getElementById('btn2');
// var input1 = document.getElementsByTagName('input')[0];
// var input2 = document.querySelectorAll('input')[1];
// btn1.onclick = function(){
// console.log(input1.getAttribute('value'));
// console.log(input1.value);
// };
// btn2.onclick = function(){
// console.log(input2.getAttribute('value'));
// console.log(input2.value);
// };
});
</script>
</head>
<body>
<button id="btn1">获取1</button>
<button id="btn2">获取2</button>
<input type="text" >
<input type="text" >
</body>
</html>