Control form elements

Abstract: Form control element


1. The text boxes, text areas:
.. $ ( "# Txt") attr ( "value "), or $ ( "# txt") val () // get the value
. $ ( "# Txt") attr ( "value ',' '); // empty the contents of
$ ( "# txt") attr (. "value",' 11 '); // fill content

2. checkboxes the checkBox: 
$ (. "# checkbox_id") attr ( . "value") or $ ( "# checkbox_id") val (); // get the value
$ ( "# chk1") attr ( "checked", '');. // uncheck
$ ( "# chk2" ) .attr ( "checked", true ); // check
. if ($ ( "# chk1 ") attr ( 'checked')) // check determines whether

3. radio group radio:
$ ( "INPUT [type = radio] [checked] ") val ();. // get the value
$ (" input [name = tt ] checked ", 'value2')") attr (. "; // set value = 'value2' the project for the currently selected item
$ ( ' input [name = items] ") get (1) .checked = true; // second value for the currently selected element.
IF ($ (! 'INPUT # Facebox [name =" post_term "]') IS (." : checked ")) {// Analyzing select


4. dropdown select:
$ ( "select [name = topSearch ] option [selected]") val ();. // get the value
$ ( "select [name = topSearch ] option [selected]") text ();. // Get the display content
$ . ( "#sel") attr ( "value", 'sel3'); // set value = 'sel3' project for the currently selected item
$ ( "# ddlregtype") .attr ( "value", "normal") ;
$ ( "# ddlregtype") .val ( "Normal");
$ ( "# ddlregtype") .get (0) .Value = value;
. $ ( "# select_id Option [text = 'jQuery']") attr ( "selected", true); // to set the context for the selected jquery



Web Design -> Web site to find a bank

Goody: Web Design deodorant socks

Original: Big Box  control form elements


Guess you like

Origin www.cnblogs.com/chinatrump/p/11514249.html