码迷,mamicode.com
首页 > Web开发 > 详细

ASP.NET绑定CHECKBOXLIST--------JQUERY绑定CLICK事件,获取CHECKBOX的VALUE和显示值

时间:2014-07-14 18:02:21      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:http   java   for   io   cti   html   

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> 

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
<title></title> 
<script src="Scripts/jquery-1.10.2.min.js"></script> 
<script type="text/javascript"> 
$(function () { 
$("input[type=‘checkbox‘]").click(function () { 
var lvalue = $(this).val();//获取value值 
// alert(lvalue); 
var lname = $(this).next().text();//获取text值 
var yuanGong = document.getElementById("TextArea1"); 
yuanGong.value = yuanGong.value + lname; 

); 
}); 



</script> 


</head> 
<body> 
<form id="form1" runat="server"> 
<div> 
<textarea id="TextArea1" cols="60" rows="6"></textarea> 
<br /> 
<asp:CheckBoxList ID="CheckBoxList1" runat="server"> 
<asp:ListItem Value="sddsds">2</asp:ListItem> 
<asp:ListItem>1221</asp:ListItem> 
<asp:ListItem>4343</asp:ListItem> 
<asp:ListItem>4343</asp:ListItem> 
<asp:ListItem>gg</asp:ListItem> 
<asp:ListItem>gfgfgf</asp:ListItem> 
</asp:CheckBoxList> 
</div> 
</form> 
</body> 
</html> 

ASP.NET绑定CHECKBOXLIST--------JQUERY绑定CLICK事件,获取CHECKBOX的VALUE和显示值,布布扣,bubuko.com

ASP.NET绑定CHECKBOXLIST--------JQUERY绑定CLICK事件,获取CHECKBOX的VALUE和显示值

标签:http   java   for   io   cti   html   

原文地址:http://www.cnblogs.com/lyl6796910/p/3842961.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!