var checkText= jQuery("#select_id").find("option:selected").text(); //Get the Text selected by Select var checkValue=jQuery("#select_id").val(); //Get the Select Selected option Value var checkIndex=jQuery("#select_id ").get(0).selectedIndex; //Get the selected index value var maxIndex=jQuery("#select_id option:last"). attr("index"); //Get the maximum index value of Select
jQuery("#select_id").append("") ; //Insert an Option for Select (the first position) jQuery("#select_id option:last").remove(); //Remove the Option with the largest index value in Select (the last one) jQuery( "#select_id option[index='0']").remove(); //Delete the Option with index value 0 in Select (the first one) jQuery("#select_id option[value='3'] ").remove(); //Delete Option with Value='3' in Select jQuery("#select_id option[text='4']").remove(); //Delete Text=' in Select 4' Option
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn