The following gives a big introduction to jquery on the operation of Select, very good, with the content is described as follows:
The HTML tag for select is as follows:
<select class= "xxx" id= "yyy" ><option></option>...<option></option></select>
1. Set option selected for value "LLL"
$ (' #yyy '). Val ("lll"), or $ ('. xxx '). val ("lll")
Can be used to allow select to automatically select an item, such as selecting a value from the background and the same as option
2. Set the text to "lll" option selected
$ (' #yyy '). Find ("option[text=" lll "]"). attr ("Selected", "selected"), or $ ('. xxx '). Find ("option[text=" lll "]"). attr ("Selected", "true");
3. Get the value of the currently selected item
$ (' #yyy '). Val (); or $ ('. xxx '). val ();
4. Gets the text of the currently selected item
$ (' #yyy '). Find ("option:selected"). Text () or $ (' #yyy option:selected '). Text ()
The above is a small series to introduce you to the jquery in the select operation detailed