-
Notifications
You must be signed in to change notification settings - Fork 0
/
0911-03-form.html
65 lines (48 loc) · 1.6 KB
/
0911-03-form.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.5.1.js"
integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script>
</head>
<body>
<form action="">
<form-group>
<label for="username"></label>
<input type="text" id="username" name="username">
</form-group>
<br>
<br>
<form-group>
<label for="password"></label>
<input type="password" id="password" name="password">
</form-group>
<br>
<br>
<button type="submit" value="submit">button</button>
<br>
<br>
<input type="checkbox" name="" id="" />
<label for="">checkbox1</label>
<br>
<input type="checkbox" name="" id="" />
<label for="">checkbox2</label>
<br>
<input type="checkbox" name="" id="" />
<label for="">checkbox3</label>
</form>
<script>
$(":input").css("background", "red")
// 連button也會一起受影響
$(":text").css("background", "blue")
$(":password").css("background", "green")
$(":submit").css("background", "yellow")
$(":checkbox").attr("checked", true);
console.log($(":disabled").attr("id"));
$(":checkbox + label").css("background", "pink")
// 希望checkbox旁邊的label改變
</script>
</body>
</html>