-
Notifications
You must be signed in to change notification settings - Fork 0
/
select.html
65 lines (61 loc) · 1.4 KB
/
select.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" />
<title>Document</title>
<style type="text/css">
div{
width: 200px;
height: 400px;
margin: 200px auto 0;
}
select::-ms-expand { display: none; }
select{
width: 300px;
height: 42px;
box-sizing: border-box;
font-size: 14px;
color: #666666;
line-height: 40px;
padding: 0px 20px 0 10px;
border: 1px solid #E5E5E5;
outline: none;
appearance:none;
-moz-appearance:none;
-webkit-appearance:none;
-ms-appearance:none;
background-color: #F5F5F5;
background-image: url(img/down.png);
background-repeat: no-repeat;
background-size: 12px 13px;
background-position: 282px center;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
margin-top: 10px;
}
select option{
background-color: #FFFFFF;
text-align: center;
}
</style>
<script src="jquery-1.10.1.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div>
<select>
<option value="第一个">第一个</option>
<option value="第二个">第二个</option>
<option value="第三个">第三个</option>
<option value="第四个">第四个</option>
</select>
</div>
</body>
</html>
<script type="text/javascript">
var text = "";
$("select").change(function(){
text = $(this).val();
alert(text);
});
</script>