jQuery radio change事件 checkbox选中事件
2016-12-05 10:45
369 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>test</title>
<script src="jquery-latest.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".radioItem").change(function() {
var $selectedvalue = $("input[name='rl$tt']:checked").val();
// alert($selectedvalue);
if ($selectedvalue == 1) {
alert('1');
} else {
alert('2');
}
});
});
</script>
</head>
<body>
<input id="rl_1" class="radioItem" checked="checked" name="rl$tt" type="radio" value="1" />
<label>1</label>
<input id="rl_2" class="radioItem" name="rl$tt" type="radio" value="2" />
<label>2</label>
</body>
</html>
<label><input name="zjsj1" id = 'zjsj1' type="checkbox" value="" />最近时间</label>
$("#zjsj1").click(function(){
if($('#zjsj1').is(':checked')) {
alert('sdf')
}
});
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>test</title>
<script src="jquery-latest.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".radioItem").change(function() {
var $selectedvalue = $("input[name='rl$tt']:checked").val();
// alert($selectedvalue);
if ($selectedvalue == 1) {
alert('1');
} else {
alert('2');
}
});
});
</script>
</head>
<body>
<input id="rl_1" class="radioItem" checked="checked" name="rl$tt" type="radio" value="1" />
<label>1</label>
<input id="rl_2" class="radioItem" name="rl$tt" type="radio" value="2" />
<label>2</label>
</body>
</html>
<label><input name="zjsj1" id = 'zjsj1' type="checkbox" value="" />最近时间</label>
$("#zjsj1").click(function(){
if($('#zjsj1').is(':checked')) {
alert('sdf')
}
});
相关文章推荐
- jquery radio/checkbox change 事件不能触发的问题
- JQuery触发radio或checkbox的change事件
- 在IE中关于Radio和Checkbox在JQuery中的change事件的立即触发
- jquery checkbox (选中和取消选中事件on("change"))做笔记
- JQuery触发radio或checkbox的change事件
- jquery checkbox选中、改变状态、change和click事件
- Jquery 判断radio,selelct,checkbox是否选中
- Jquery判断radio,selelct,checkbox是否选中及选中的值
- jquery获取radio和checkbox选中的值
- JQuery触发Checkbox的change事件
- jQuery设置 select、radio、checkbox 默认选中的值
- 【转】Jquery实际应用,判断radio,selelct,checkbox是否选中及选中的值
- jquery实用应用之jquery操作radio、checkbox、select选中
- jquery判断checkbox,radio是否选中(转载自己用)
- Jquery实际应用,判断radio,selelct,checkbox是否选中及选中的值
- jquery 获得 选中 radio或checkbox
- jQuery学习笔记--jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关属性
- jquery checkbox,radio是否选中的判断代码
- Jquery中Radio,checkbox判断是否选中的问题
- jQuery基础:select、checkbox、text、radio取值、选中、删除等