File tree 2 files changed +72
-0
lines changed
2 files changed +72
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE>
2
+ < html >
3
+ < head >
4
+ < meta http-equiv ="content-type " content ="text/html;charset=utf8 "/>
5
+ < style > </ style >
6
+ < script >
7
+ window . onload = function ( ) {
8
+
9
+ }
10
+ </ script >
11
+ </ head >
12
+ < body > </ body >
13
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE>
2
+ < html >
3
+ < head >
4
+ < meta http-equiv ="content-type " content ="text/html;charset=utf8 "/>
5
+ < style >
6
+ * {
7
+ margin : 0 ;
8
+ padding : 0 ;
9
+ }
10
+ # outer {
11
+ width : 300px ;
12
+ margin : 10px auto;
13
+ }
14
+ ul {
15
+ list-style : none;
16
+ color : aqua;
17
+ border : 1px solid blue;
18
+ width : 80px ;
19
+ margin-top : 5px ;
20
+ }
21
+ ul li {
22
+ padding : 6px ;
23
+ }
24
+ ul li : hover {
25
+ cursor : pointer;
26
+ background-color : # ccc ;
27
+ }
28
+ ul li : nth-child (3 ){
29
+ border-top : 1px solid aqua;
30
+ }
31
+ </ style >
32
+ < script >
33
+ window . onload = function ( ) {
34
+ var input = document . getElementById ( 'input' ) ;
35
+ var list = document . getElementById ( 'list' ) ;
36
+ input . onclick = function ( ) {
37
+ if ( 'none' == list . style . display ) {
38
+ list . setAttribute ( 'style' , 'display:block' ) ;
39
+ } else {
40
+ list . setAttribute ( 'style' , 'display:none' ) ;
41
+ }
42
+ }
43
+ list . children . item ( 2 ) . onclick = function ( ) {
44
+ list . setAttribute ( 'style' , 'display:none' ) ;
45
+ }
46
+ }
47
+ </ script >
48
+ </ head >
49
+ < body >
50
+ < div id ="outer ">
51
+ < button id ="input "> 输入法</ button >
52
+ < ul id ="list " style ="display:none ">
53
+ < li > 手写</ li >
54
+ < li > 拼音</ li >
55
+ < li > 关闭</ li >
56
+ </ ul >
57
+ </ div >
58
+ </ body >
59
+ </ html >
You can’t perform that action at this time.
0 commit comments