文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>使用Jquery 将DropDownlist的选中值赋给label

使用Jquery 将DropDownlist的选中值赋给label

时间:2011-05-04  来源:alents

jquery代码-------------------

$(function() {
            $("#DropDownList1").bind("change", function() {
                $("#Label1").text($("#DropDownList1 option:selected").text());

            });

或者

  $("#DropDownList1").bind("change", function() {
               $("#Label1").text($("#DropDownList1").val());
                   });

其中对这个解释下:

var name = $("#DropDownList1 option:selected").val(); //获取dropdownlist 里面选中的值
var name1 = $("#DropDownList1").text();  //获取dropdownlist 里面所用的值

相关阅读 更多 +
排行榜 更多 +
西安交大通

西安交大通

生活实用 下载
长江云通

长江云通

生活实用 下载
translatez

translatez

生活实用 下载