jquery Gets the text and value selected by select:
1. Var checktext=jquery ("#select_id"). Find ("option:selected"). Text (); Gets the text selected by the Select
2. Var checkvalue=jquery ("#select_id"). Val (); Gets the option Value selected by select
3. Var checkindex=jquery ("#select_id"). Get (0). SelectedIndex; Gets the index value of the Select selection
4. Var maxindex=jquery ("#select_id option:last"). attr ("index"); Gets the maximum index value of the Select
jquery Add/Remove option for select:
1. JQuery ("#select_id"). Append ("<option value= ' value ' >Text</option>"); Append an option to the Select (drop-down item)
2. JQuery ("#select_id"). Prepend ("<option value= ' 0 ' > Please select </option>"); Insert an option for select (first position)
3. JQuery ("#select_id option:last"). Remove (); Delete index value in select maximum option (last)
4. JQuery ("#select_id option[index= ' 0 ')". Remove (); Delete option with index value 0 in select (first)
5. JQuery ("#select_id option[value= ' 3 ')". Remove (); Delete option for value= ' 3 ' in select
6. JQuery ("#select_id option[text= ' 4 ')". Remove (); Delete option for text= ' 4 ' in select
Content empty:
JQuery ("#select_id"). empty ();
JQuery Add delete modifies select option.