File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ This class allows the INPUT element types RADIO and CHECKBOX to behave more natu
6
6
## Dependence
7
7
8
8
- ** none**
9
- ---
10
9
11
10
Install
12
11
--------
Original file line number Diff line number Diff line change @@ -9,9 +9,39 @@ <h1>Example</h1>
9
9
< hr />
10
10
< label > < input type ="radio " name ="Radio " /> Radio1</ label >
11
11
< label > < input type ="radio " name ="Radio " /> Radio2</ label >
12
- < label > < input type ="radio " name ="Radio " /> Radio3</ label >
12
+ < label > < input type ="radio " name ="Radio " /> Radio3</ label >
13
+
14
+ < hr />
15
+ < br />
16
+ < b > Demonstration:</ b >
17
+ < p >
18
+ < button onclick ="ex1(1) "> Set value 1 to CHECKBOX "Some label ONE"</ button >
19
+ < button onclick ="ex1(0) "> Set value 0 to CHECKBOX "Some label ONE"</ button >
20
+ </ p >
21
+ < p >
22
+ < button onclick ="exR0() "> Set value 1 to RADIO "Radio1"</ button >
23
+ < button onclick ="exR1() "> Set value 1 to RADIO "Radio2"</ button >
24
+ < button onclick ="exR2() "> Set value 1 to RADIO "Radio3"</ button >
25
+ < button onclick ="exRV() "> GET value from RADIO group</ button >
26
+ </ p >
13
27
< script >
14
28
new pseudoNatural ( document . getElementsByTagName ( "input" ) ) ;
29
+
30
+ function ex1 ( val ) {
31
+ document . getElementById ( "one" ) . value = val ;
32
+ }
33
+ function exR0 ( ) {
34
+ document . querySelectorAll ( "input[name='Radio']" ) [ 0 ] . value = 1 ;
35
+ }
36
+ function exR1 ( ) {
37
+ document . querySelectorAll ( "input[name='Radio']" ) [ 1 ] . value = 1 ;
38
+ }
39
+ function exR2 ( ) {
40
+ document . querySelectorAll ( "input[name='Radio']" ) [ 2 ] . value = 1 ;
41
+ }
42
+ function exRV ( ) {
43
+ alert ( document . querySelector ( "input[name='Radio']" ) . nameValue ( ) ) ;
44
+ }
15
45
</ script >
16
46
</ body >
17
47
</ html >
You can’t perform that action at this time.
0 commit comments