点击checkbox,触发事件
时间选择:
起始时间:<input type="text" value="2016-03-21 12:24:10" id="starttime" size="" class="m-wrap wid200 " onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
结束时间:<input type="text" value="2017-03-21 12:24:10" size="" class="m-wrap wid200 " id="startime1" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
checkbox复选框:
<input type="checkbox" value="" style="opacity: 0;" id="callever" name="callever">
<script>
// 区域报警设置的是否每天报警的时间不可选择的js
$(function(){
$("#callever").change(function(){
if($("#callever").prop("checked")){ //prop()函数用于设置或返回当前jQuery对象所匹配的元素的属性值,复选框被选中时
$("#starttime").attr('readonly','readonly'); //时间input文本添加属性值
document.getElementById("starttime").style.color='rgb(173, 173, 173)';
document.getElementById("starttime").onclick=function(){};
$("#startime1").attr('readonly','readonly');
document.getElementById("startime1").style.color='rgb(173, 173, 173)';
document.getElementById("startime1").onclick=function(){}; }else{
document.getElementById("starttime").style.color='rgb(63, 63, 63)';
document.getElementById("startime1").style.color='rgb(63, 63, 63)';
$("#starttime").removeAttr('readonly','');
$("#startime1").removeAttr('readonly','');
document.getElementById("starttime").onclick=function(){laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})};
document.getElementById("startime1").onclick=function(){laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})};
}
})
}) </script>
点击checkbox,触发事件的更多相关文章
- Checkbox: ListView 与CheckBox 触发事件冲突的问题
我相信很多人都遇到过 ListView 中放入checkBox ,会导致ListView的OnItemClickListener无效,这是怎么回事呢? 这是因为checkBox 的点击事件的优先级比L ...
- js点击空白处触发事件
我们经常会出现点击空白处关闭弹出框或触发事件 <div class="aa" style="width: 200px;height: 200px;backgroun ...
- 点击 Button触发事件将GridView1 CheckBox勾选的行添加到GridView2中
有时候想实现一个CheckBox选取功能,但是很多细节不是很清楚 相信大家都有遇到类似的情况,直接看代码,如下: 前端代码GridView1,CheckBox控件设置 <asp:GridView ...
- 【小程序】bindconfirm点击小键盘触发事件、focus自动获取焦点
最近在写小程序,项目要求写一个搜索框,在进入页面时就触发input的事件,调出键盘,点小键上的搜索按钮 就触发搜索事件,分享一下. bindconfirm 是点击小键盘上的搜索按钮就触发要执行的方法 ...
- echarts柱状图点击阴影部分触发事件
在很多时候我们的柱状图分布不均匀,有些柱高可能会很小,如果通过myChart.on('click',function(){})来促发事件,可能在点击的时候不好操作,因为这个click事件是绑定在各个s ...
- js点击按钮触发事件的方法
<!DOCTYPE html> <html> <body> <h1>My First Web Page</h1> <input id= ...
- ztree点击加号+触发ajax请求
之前做的时候一直是点击节点才触发ajax事件,配置如下:发现点击节点前面的“+”没有反应,后来发现,应该添加一个折叠的事件. onExpand:zTreeOnClick事件和onClick的一样. v ...
- jquery点击复选框触发事件给input赋值
体验效果:http://keleyi.com/keleyi/phtml/jqtexiao/31.htm 代码如下: <!DOCTYPE html> <html xmlns=" ...
- 给Jqgrid添加横向滚动条,实现点击行数据,触发事件。
function reloadNoKitScheduleGridData() { $("#noKittingScheduleList").jqGrid({ url: ". ...
- GridView点击行触发SelectedIndexChanged事件
1.在<% @Page ...... %>指令中添加 EnableEventValidation="false" 2.在RowDataBound事件中添加 protec ...
随机推荐
- Qt Load and Save Image Dialog 加载图片对话框
在Qt中,我们想要通过对话框来打开某一个图片,可以通过使用QFileDialog来快速实现,参见以下代码: QString fileName = QFileDialog::getOpenFileNam ...
- CSS3初学篇章_2(伪类选择符)
id与class选择符 id与class选择符都是自定义标签名字的选择符,但id是唯一的,class却可重复使用. id选择符以"#"定义 class选择符以".&quo ...
- WordPress的body_class()函数详解
wordpress的body_class()函数,顾名思义,这个函数根据不同的页面类型为body标签生成class选择器,从而让设计人员可以各方便灵活的控制不同页面中的各个元素.本文对这一函数进行了详 ...
- windows 7 安装 telnet
telnet 192.168.1.10 8080
- String的hashcode(java)
hashCode就是我们所说的散列码,使用hashCode算法可以帮助我们进行高效率的查找,例如HashMap,说hashCode之前,先来看看Object类. Java程序中所有类的直接或间接父类, ...
- Adding supplementary tables and figures in LaTeX【转】
\renewcommand{\thetable}{S\arabic{table}} \renewcommand{\thefigure}{S\arabic{figure}} 这样就以Table S1, ...
- 节点操作-创建并添加&删除节点&替换&克隆节点
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" ...
- 【iCore3 双核心板】例程八:定时器PWM实验——呼吸灯
实验指导书及代码包下载: http://pan.baidu.com/s/1dEnH5dB iCore3 购买链接: https://item.taobao.com/item.htm?id=524229 ...
- A trip through the Graphics Pipeline 2011_10_Geometry Shaders
Welcome back. Last time, we dove into bottom end of the pixel pipeline. This time, we’ll switch ...
- smarty模板原理和增删改查例题
Smarty模板:(前后端分离)原理:核心是一个类,先修改配置文件,在使用的时候引入配置文件即可,(init.inc.php)$smarty->assign("ceshi", ...