-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrework.html
36 lines (31 loc) · 884 Bytes
/
rework.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
34
35
36
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<input id="1" type="checkbox" value="1" >1 <br>
<input id="2" type="checkbox" value="2" checked>2 <br>
<input id="3" type="checkbox" value="3" >3 <br>
<input id="4" type="text" value="just for test">
<button>按钮</button>
<script src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(function(){
const check = document.getElementById('2')
const cheBox1 = $('#1')
const cheBox2 = $('#2')
const cheBox3 = $('#3')
const input = $('#4')
$('button').click(function() {
cheBox1.prop('checked', true)
// console.log(input.attr('value'))
console.log(cheBox3 .attr('checked'))
input.prop('value', 123)
// console.log(input.attr('value'))
})
})
</script>
</body>
</html>