基于Jquery的将DropDownlist的选中值赋给label的实现代码
摘要:jquery代码复制代码代码如下:$(function(){$("#DropDownList1").bind("change",functi...
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 里面所用的值
【基于Jquery的将DropDownlist的选中值赋给label的实现代码】相关文章:
★ jQuery的Scrollify插件实现滑动到页面下一节点
★ 让插入到 innerHTML 中的 script 跑起来的实现代码
★ jQuery异步上传文件插件ajaxFileUpload详细介绍
下一篇:
基于jQuery的倒计时插件代码