复选框

jQuery实现的全选、反选和不选功能

喜夏-厌秋 提交于 2020-01-19 03:49:08
适用于网页多选后需要进行批量操作的场景(如批量删除等)。如有问题希望大家可以指正。谢谢~~ HTML 我们的页面上有一个歌曲列表,列出多行歌曲名称,并匹配复选框供用户选择,并且在列表下方有一排操作按钮 < ul id = "list" > < li > < label > < input type = "checkbox" value = "1" > 1. 时间都去哪儿了 < / label > < / li > < li > < label > < input type = "checkbox" value = "2" > 2. 海阔天空 < / label > < / li > < li > < label > < input type = "checkbox" value = "3" > 3. 真的爱你 < / label > < / li > < li > < label > < input type = "checkbox" value = "4" > 4. 不再犹豫 < / label > < / li > < li > < label > < input type = "checkbox" value = "5" > 5. 光辉岁月 < / label > < / li > < li > < label > < input type = "checkbox"

bootstrap复选框和单选按钮

只谈情不闲聊 提交于 2020-01-15 21:22:10
复选框和单选按钮标签包含在<Label>标签中<div class="checkbox"> <label><input type="checkbox" value="">选项 1</label> </div> <div class="checkbox"> <label><input type="checkbox" value="">选项 2</label> </div> <div class="radio"> <label> <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked> 选项 1 </label> </div> <div class="radio"> <label> <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2"> 选项 2 - 选择它将会取消选择选项 1 </label>内联的复选框和单选按钮, 对一系列复选框和单选框使用 .checkbox-inline 或 .radio-inline class,控制它们显示在同一行上。 <div> <label class="checkbox-inline"> <input type="checkbox" id=

复选框全选

試著忘記壹切 提交于 2020-01-15 21:07:59
复选框 <p class="copy_td"><input type="checkbox" class="input_check" id="checkbox11"><label for="checkbox11"></label></p> p {position: relative;} p .input_check {position: absolute;visibility: hidden; } p .input_check+label {display: inline-block;position: absolute;top: -10px;background: url(../images/checkboxno.png) left center no-repeat;width:80px; height: 16px; background-size: 16px; visibility: visible;} p .input_check:checked+label:after {content: "";position: absolute;left: 0px;background: url(../images/checkboxyes.png) left center no-repeat;width:80px; height: 16px;line-height: 16px;

全选复选框

匆匆过客 提交于 2020-01-15 14:59:38
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <script type="text/javascript"> function selectAll(){ var qx = document.getElementById("c"); var goods = document.getElementsByName("good"); if(qx.checked == true){ for(var i = 0;i<goods.length;i++){ goods[i].checked = true; } }else{ for(var i = 0;i<goods.length;i++){ goods[i].checked = false; } } } function check(){ var flag = true; var qx = document.getElementById("c"); var

如何安装mysql软件

故事扮演 提交于 2020-01-15 04:20:51
---恢复内容开始--- 本文非原创,引自“渣儿很好吃” MySQL安装教程(Windows系统) 渣儿很好吃 发布时间:04-02 08:53 本文摘自 千锋教育高教产品研发部编著的 《MySQL数据库从入门到精通》,如需转载,请标明来源,谢谢! 1.2.1MySQL的下载 登录https://dev.mysql.com/downloads/mysql/5.5.html#downloads,进入官网下载页面,如图1.3所示。 基于Windows平台的MySQL安装文件有两个版本,一种是以.msi为后缀的二进制安装版本,一种是以.zip为后缀的压缩版本,如图1.4所示。 这里以.msi的二进制版本为例讲解如何安装,根据电脑的操作位数,选择需要下载的安装文件,这里以64位的安装文件为例点击下载,下载完成后,安装文件如图1.5所示。 1.2.2MySQL的安装 双击安装文件进行安装,此时会弹出MySQL安装向导界面,如图1.6所示。 单击图1.6中的“Next”按钮,此时会显示用户许可协议界面,如图1.7所示。 将图1.7中的确认项勾选,然后点击“Next”按钮,如图1.8所示。 图1.8中,显示了三种可选的安装类型,三种类型的含义具体如下。l Typical(典型安装):只安装MySQL服务器、MySQL命令行客户端和命令行使用程序。 l Custom(自定义安装)

自定义样式的复选框的change事件监听

混江龙づ霸主 提交于 2020-01-10 10:58:29
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> <style> .base-checkbox { font-size: 24px; color: #ffffff; position: relative; cursor: pointer; font-weight: normal; overflow: hidden; padding-left: 34px; } .base-checkbox input[type="checkbox"] { width: 22px; height: 22px; width: 1px; height: 1px; position: absolute; left: -22px; top: 0; } .base-checkbox::before { content: " "; display: inline-block; width: 22px; height: 22px; border: 1px solid #ed9429; position: absolute; left: 0; top: 0; bottom: 0; margin: auto; cursor: pointer; } .base-checkbox.checked:before { background-color: #ed9429; } </style> <label

纯js全选、多选

≯℡__Kan透↙ 提交于 2020-01-09 22:31:09
使用纯js来写一个模拟购物车的全选和多选功能。 思路:   1、需要给每一个input设置点击事件   2、全选就是把所有的checkbox设置为true   3、取消一个不全选,就是判断是否全部的checkbox都被选了 代码: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <input type="checkbox" id="all"/>全选 <div id="checkbox"> <input type="checkbox"/>选择一 <br/> <input type="checkbox"/>选择二 </div> <script> //获取全选按钮 var all = document.getElementById("all"); //获取div中所有的复选框 var checkboxs = document.getElementById("checkbox").getElementsByTagName("input"); //点击全选,获取他当前的状态并设置新的状态 all.onclick = function(){ for(var i = 0;i < checkboxs.length; i++){ checkboxs[i]

下拉复选框

匆匆过客 提交于 2020-01-09 20:49:53
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>下拉多选</title> <script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script> <style> ul li{ list-style: none; } .hide{display: none} .width150{ width: 150px; } .width150 input[type="text"]{ width: 100%; height: 32px; border: 1px solid #ccc; border-radius: 4px; padding-left: 12px; } .width150 ul{ width: 96%; padding: 0 0 0 20px; margin: 0; border: 1px solid #ccc; } .width150 li{ padding: 5px; } .width150 li+li{ border-top: 1px solid #ccc; } </style> </head> <body> <form id="form"> <div class="width150"> 可多选年份:<input

jQuery Validation Engine 表单验证

大兔子大兔子 提交于 2020-01-09 09:29:32
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 中文汉化版,官方只有英文的。同时根据中国国情修改了部分验证规则。 这个插件支持大部分的浏览器,但由于有使用到了css3的阴影和圆角样式,所以在IE浏览器下无法看到圆角和阴影效果(万恶的IE)。 官方下载地址: http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ 普通验证的例子: http://www.position-relative.net/creation/formValidator/ ajax验证的例子: http://www.position-relative.net/creation/formValidator/demoSubmit.html 一:简单说明下使用教程: 引入jquery和插件js、css <link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" charset="utf-8" /> <script src="js/jquery.js" type="text/javascript"></script> <script

icheck-bootstrap的应用

自作多情 提交于 2020-01-08 02:15:09
icheck-bootstrap 效果演示,地址:http://www.htmleaf.com/Demo/201805245139.html //获取复选框的内容值 $ ( ".yw input[type='checkbox']" ) . on ( 'click' , function ( ) { $ ( '.ggbtn' ) . trigger ( 'click' ) } ) $ ( '.ggbtn' ) . on ( 'click' , function ( ) { //弹出结果 var arr_v = new Array ( ) ; $ ( "input[type='checkbox']:checked" ) . each ( function ( ) { arr_v . push ( $ ( this ) . val ( ) ) ; } ) ; arr_v . join ( ',' ) ; console . log ( arr_v ) ; } ) 来源: CSDN 作者: 做块泥 链接: https://blog.csdn.net/weixin_37787674/article/details/103880012