-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonChange.html
More file actions
58 lines (37 loc) · 1003 Bytes
/
onChange.html
File metadata and controls
58 lines (37 loc) · 1003 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>onChange 事件</title>
<script type="text/javascript">
function onChange() {
console.log(" 女神已经改变!")
}
window.onload=function () {
var sltBtn=document.getElementById("selectboy");
sltBtn.onchange=function(){
console.log("选了了心目中的男神!")
}
}
</script>
</head>
<body>
请选择你心中的女神:
<select onchange="onChange()">
<option>--女神--</option>
<option>张韶涵</option>
<option>柳岩</option>
<option>刘亦菲</option>
<option>贾玲</option>
</select>
</br>
请选择你心中的男神:
<select id="selectboy">
<option>--男神--</option>
<option>汪方晨</option>
<option>易小川</option>
<option>刘德华</option>
<option>王总</option>
</select>
</body>
</html>