Skip to content

Commit 9717d30

Browse files
committed
Example
1 parent 56d6011 commit 9717d30

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ This class allows the INPUT element types RADIO and CHECKBOX to behave more natu
66
## Dependence
77

88
- **none**
9-
---
109

1110
Install
1211
--------

index.html

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,39 @@ <h1>Example</h1>
99
<hr />
1010
<label><input type="radio" name="Radio" />Radio1</label>
1111
<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>
1327
<script>
1428
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+
}
1545
</script>
1646
</body>
1747
</html>

0 commit comments

Comments
 (0)