jquery code
$(function() {
$ ("#DropDownList1").bind("change", function() {
$("#Label1").text($("#DropDownList1 option:selected").text());
});
or
$("#DropDownList1").bind("change", function() {
$("#Label1").text($("#DropDownList1").val());
});
Explanation of this:
var name = $("#DropDownList1 option:selected").val(); //Get the selected value in dropdownlist
var name1 = $("#DropDownList1").text(); //Get the value used in dropdownlist
Statement: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