1 <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
2 < Html >
3 < Head >
4 < Title > Disabled </ Title >
5 < Style Type = "Text/CSS" >
6 * { Margin : 0px ; Padding : 0px }
7 . Button { Border : 1px solid #950074 ; Width : 180px ; Height : 24px ; Line-height : 24px ; Text-align : Center ; Font-size : 12px }
8 </ Style >
9 < Script Type = "Text/JavaScript" SRC = "Jquery-1.4.1.min.js" > </ Script >
10 < Script Type = "Text/JavaScript" >
11 Window. onload = Function ()
12 {
13 VaR Getbutton = Document. getelementsbytagname ( ' Input ' )[ 0 ];
14 VaR Getdiv = Document. getelementsbytagname ( ' Div ' )[ 0 ];
15 VaR Dragging = True ; // Set the status;
16 Getdiv. classname = " Button " ; // Dynamically add CSS styles;
17 Getbutton. onclick = Function ()
18 {
19 If (Dragging = True )
20 {
21 Getdiv. style. Display = " None " ;
22 This . Value = " Show text "
23 Return Dragging = False ;
24 }
25 Else
26 {
27 Getdiv. style. Display = " Block " ;
28 This . Value = " Hide text "
29 Return Dragging = True ;
30 }
31 }
32 }
33 </ Script >
34 </ Head >
35 < Body >
36 < Div >
37 < P > My content is text !! < P >
38 </ Div >
39 < Input Type = "Button" Value = "Hide text" >
40 </ Body >
41 </ Html >
Summary:
Set whether the status is displayed;