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 里面所用的值
延伸阅读
- 2011-8-16-- jquery,JQuery最佳实践
- 2011-8-16-- jquery,JQuery设计思想
- 2010-12-9-- jquery,超越Jquery_01_isPlainObject分析与重构
- 2010-11-24-- jquery,jQuery语法总结及注意事项
- 2010-12-15-- jquery,jQuery 1.3 发布
- 2010-12-15-- jquery,我所理解的jQuery(1)--jQuery前传JavaScript101
- 2010-12-9-- jquery,Asp.net下用JQuery找出哪一个元素引起PostBack
- 2010-12-9-- jquery,jquery提升性能最佳实践小结
- 2010-11-24-- jquery,基于jQuery打造智能的人员选择输入框
- 2010-12-9-- jquery,jQuery示例收集
最新评论