Jquery radio, checkbox, select, radio, checkbox, select, and related 1. obtain the value of jquery. Obtain the value of the radio button [html] $ ("input [name = 'items ']: checked "). val (); get the value of a set of items selected by radio [html] var item =$ ('input [name = items] [checked] '). val (); obtain the text of the selected select item [html] var item =$ ("select [name = items] option [selected]"). text (); the second element in the select drop-down box is the currently selected value [html] $ ('# select_id') [0]. selectedIndex = 1; the second element of the radio Group is the currently selected value [html] $ ('input [nam E = items] '). get (1 ). checked = true; text box, text area: [html] $ ("# txt "). attr ("value"); multiple choice box checkbox: [html] $ ("# checkbox_id "). attr ("value"); single-choice radio: [html] $ ("input [type = radio] [checked]"). val (); drop-down box select: [html] $ ('# sel '). val (); 2. control Form element: text box, text area: [html] $ ("# txt "). attr ("value", ''); // clear the content $ (" # txt "). attr ("value", '11'); // multiple-choice box for filling content checkbox: [html] $ ("# chk1 "). attr ("checked", ''); // do not tick $ (" # chk2 "). attr ("checked", true );// Tick if ($ ("# chk1 "). attr ('checked') = undefined) // determines whether the radio group radio has been checked: [html] $ ("input [type = radio]"). attr ("checked", '2'); // select: $ ("# sel") for the project whose value is set to 2 "). attr ("value", '-sel3 '); // set the value =-sel3 project to the currently selected item $ ("<option value = '1'> 1111 </option> <option value = '2'> 2222 </ option> "). appendTo ("# sel") // Add option $ ("# sel") in the drop-down box "). empty (); // clear the drop-down list. Note: When $ ("# id") is used to obtain the input element of the page, $ ("# id") is found "). the value cannot be obtained. Later, with the help of the great Baidu, the problem was found. Cause: $ ("") is a jquery object, instead of a dom element value. It is the attribute of dom element. jquery corresponds to val (): obtains the current value of the First Matching Element. Val (val): sets the value of each matching element. Therefore, the code should be written as follows: [html]; Value: val = $ ("# id") [0]. value; value: $ ("# id") [0]. value = "new value"; or $ ("# id "). val ("new value"); or you can: val = $ ("# id "). attr ("value ");