Input
var xxx = $ (' #ID '). Val ()
---------------------------------------------------------------------------------
CheckBox
var xxx = [];
$ (' input[name=myname]:checked '). each (function (index, Element) {
Xxx.push ($ (Element). val ());
Or Xxx.push ($ (this). Val ());
Note: This is not based on IDs, some are not rigorous. If your checkbox element is a child element of a container (assuming that the container has an ID of con_id), you can choose:
======
$ (' #con_id input[name=myname]:checked ')
or
$ (' input[name=myname]:checked ', ' #con_id ')
----------------------------------------------------------------------------------
Radio
var xxx = $ (' input[name=myname]:checked '). Val ();
======
Note: This is not based on IDs. To limit the specified ID, refer to the checkbox above
----------------------------------------------------------------------------------
Select
var xxx = $ ("#ID option:selected"). Val ();
======
Note two points:
1.select the selected property is "seleted" and not "checked".
2.select default is "single", if it is multiple selection (multiple), I have not tried. Presumably with. each () can be processed.