Home > Java > javaTutorial > body text

How to get the value of drop-down box option?

PHP中文网
Release: 2017-06-21 09:16:54
Original
4979 people have browsed it

Get the value in option:

(2)
var selectlength = $("#type option").length;
alert(selectlength);
for(var i = 0; i {
alert($("#type option").get(i).value);
if($("#type option"). get(i).value == d.TYPE_ID) //Compare the value of the option with the value in json. If they are equal, set this value as the default selected item
{
//var select =document.getElementById("type");
//alert(sel.options[select.selectedIndex].text);
//var aa=$("#type option").get(i) ;
//$("#type option[value='"+ d.TYPE_ID +"']").attr('selected',true);
//alert("selected"+$ ("#type").find("option:selected").text());
$('#type').combobox('select',d.TYPE_ID); // Set the list in easyUI Display value

}
}

The above is the detailed content of How to get the value of drop-down box option?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template