源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

基于Jquery的将DropDownlist的选中值赋给label的实现代码

  • 时间:2021-04-18 02:18 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:基于Jquery的将DropDownlist的选中值赋给label的实现代码
jquery代码
[u]复制代码[/u] 代码如下:
$(function() { $("#DropDownList1").bind("change", function() { $("#Label1").text($("#DropDownList1 option:selected").text()); });
或者
[u]复制代码[/u] 代码如下:
$("#DropDownList1").bind("change", function() { $("#Label1").text($("#DropDownList1").val()); });
其中对这个解释下: var name = $("#DropDownList1 option:selected").val(); //获取dropdownlist 里面选中的值 var name1 = $("#DropDownList1").text(); //获取dropdownlist 里面所用的值
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部