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

时间:2011-05-06    点击:52   
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将文本转化成JSON对象需要注意的问题
通过Jscript中@cc_on 语句识别IE浏览器及版本的代码
基于JQUERY的两个ListBox子项互相调整的实现代码
基于jquery的lazy loader插件实现图片的延迟加载[简单使用]
基于jQuery的倒计时插件代码
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved