File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 2
2
Set values to INPUTS types CHECKBOX and RADIO
3
3
4
4
This class allows the INPUT element types RADIO and CHECKBOX to behave more naturally as inputs with type text
5
+ > The values of the elements
6
+ >> 0 =false
7
+ >> 1 =true
5
8
6
9
## Dependence
7
10
@@ -37,6 +40,22 @@ var elements=document.getElementsByTagName("input");
37
40
var pointer= new pseudoNatural (elements);
38
41
39
42
// add new element to class
40
- var element= document .getElementById (" someID" )
43
+ var element= document .getElementById (" someID" );
41
44
pointer .addElement (element);
45
+ ```
46
+
47
+ Usage
48
+ -----
49
+ - ** Change value**
50
+ ``` javascript
51
+ // select element and change his value
52
+ document .getElementById (" someID" ).value = 1 ;
53
+ // and that's it, the script will be take care of the rest
54
+ ```
55
+
56
+ - ** Get value from radio group**
57
+ ``` javascript
58
+ // select element and change his value
59
+ document .querySelector (" input[name='SomeRadiosName']" ).nameValue ();
60
+ // and that's it, method returns the index of the selected element
42
61
```
You can’t perform that action at this time.
0 commit comments