Juerry 实现让复选框实现单选
来源:互联网 发布:js 字符串分割split 编辑:程序博客网 时间:2024/05/22 03:18
今天做项目是遇到一个问题想实现复选框中单选,但有不想直接使用input的radio,其一难看,其二点了无法返回
所以这样实现了:
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>我爱学习</title><jsp:include page="../inc.jsp"></jsp:include><script>$(function(){ $('#test').children('input[type=checkbox]').click(function(){ if($(this).is(':checked')){ $(this).attr('checked',true).siblings().attr('checked',false); alert($(this).val()); }else{ $(this).attr('checked',false).siblings().attr('checked',false); } });});</script></head><body><div id="test"> <input type="checkbox" value="php" />php <input type="checkbox" value="html/css" />html/css <input type="checkbox" value="jquery" />jquery <input type="checkbox" value="javascript" />javascript <input type="checkbox" value="mysql" />mysql</div></body></html>
0 0
- Juerry 实现让复选框实现单选
- 复选框实现单选
- 复选框实现单选效果
- JQuery复选框实现全选、单选
- javascript实现复选框实现单选按钮功能
- easyUI 点击行文本,实现单选;点击复选框,实现复选;
- 单选、复选框、下拉列表等实现
- JavaScript实现单选按钮、复选框赋值方法
- ZTree 实现 单选和复选组合
- 如何让checkbox复选框只能单选
- jquery实现复选框多选、单选、全不选功能,很实用
- JQuery实现三大控件方法,(下拉,单选,复选)
- JQuery实现三大控件方法,(下拉,单选,复选)
- iOS开发tableView实现单选和复选
- iOS开发tableView实现单选和复选
- 微信小程序--单选复选按钮组的实现
- 将复选框实现单效果的代码
- 点击表格行时,实现复选框或者单选按钮反选
- 这个网站, 你值得拥有!
- C#中数组、ArrayList和List三者的区别 .
- idea-maven查看jar依赖
- 黑马程序员-java-反射2
- Java--泛型
- Juerry 实现让复选框实现单选
- 黑马程序员-java-多线程2
- json 解析
- C语音数据类型转换
- [LeetCode]Single Number
- elasticsearch的研究与使用(一)
- POJ 1330 Nearest Common Ancestors 树
- BeautifulSoup中使用正则表达式re
- web.xml配置详解