时间选择:
起始时间:<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,触发事件的更多相关文章

  1. Checkbox: ListView 与CheckBox 触发事件冲突的问题

    我相信很多人都遇到过 ListView 中放入checkBox ,会导致ListView的OnItemClickListener无效,这是怎么回事呢? 这是因为checkBox 的点击事件的优先级比L ...

  2. js点击空白处触发事件

    我们经常会出现点击空白处关闭弹出框或触发事件 <div class="aa" style="width: 200px;height: 200px;backgroun ...

  3. 点击 Button触发事件将GridView1 CheckBox勾选的行添加到GridView2中

    有时候想实现一个CheckBox选取功能,但是很多细节不是很清楚 相信大家都有遇到类似的情况,直接看代码,如下: 前端代码GridView1,CheckBox控件设置 <asp:GridView ...

  4. 【小程序】bindconfirm点击小键盘触发事件、focus自动获取焦点

    最近在写小程序,项目要求写一个搜索框,在进入页面时就触发input的事件,调出键盘,点小键上的搜索按钮 就触发搜索事件,分享一下. bindconfirm 是点击小键盘上的搜索按钮就触发要执行的方法 ...

  5. echarts柱状图点击阴影部分触发事件

    在很多时候我们的柱状图分布不均匀,有些柱高可能会很小,如果通过myChart.on('click',function(){})来促发事件,可能在点击的时候不好操作,因为这个click事件是绑定在各个s ...

  6. js点击按钮触发事件的方法

    <!DOCTYPE html> <html> <body> <h1>My First Web Page</h1> <input id= ...

  7. ztree点击加号+触发ajax请求

    之前做的时候一直是点击节点才触发ajax事件,配置如下:发现点击节点前面的“+”没有反应,后来发现,应该添加一个折叠的事件. onExpand:zTreeOnClick事件和onClick的一样. v ...

  8. jquery点击复选框触发事件给input赋值

    体验效果:http://keleyi.com/keleyi/phtml/jqtexiao/31.htm 代码如下: <!DOCTYPE html> <html xmlns=" ...

  9. 给Jqgrid添加横向滚动条,实现点击行数据,触发事件。

    function reloadNoKitScheduleGridData() { $("#noKittingScheduleList").jqGrid({ url: ". ...

  10. GridView点击行触发SelectedIndexChanged事件

    1.在<% @Page ...... %>指令中添加 EnableEventValidation="false" 2.在RowDataBound事件中添加 protec ...

随机推荐

  1. iOS Notification 的使用

    Notification post notification,notification,notification,notification,notification,n otification ,no ...

  2. GUID相关知识。。。。转载

              全局唯一标识符(GUID,Globally Unique Identifier)是一种由算法生成的二进制长度为128位的数字标识符.GUID主要用于在拥有多个节点.多台计算机的网络 ...

  3. winfrom 无边框窗体移动和阴影

    无边框窗体移动: //窗体移动API [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [ ...

  4. 关于JS的算法

    一.快速排序 function qSort(arr) { if(arr.length === 0) { return []; } var left = []; var right = []; var ...

  5. ArcGIS Server 10.1 错误 service failed to start,

    启动发布的地图服务时出现如下错误: ERROR: service failed to start, ServiceStarter thread timeout. 具体原因未知. Google中说了可能 ...

  6. IOS彩票第三天界面

    ******ios6 和ios7的适配 ILBaseTableViewController.m - (void)viewDidLoad { [super viewDidLoad]; // 244 24 ...

  7. Python强化训练笔记(四)——字典的排序

    假如有学生成绩以字典顺序排列:{'Tom': 87, 'Jack': 90, 'Rose': 100.....} 想要根据学生的成绩来进行排序,可以考虑使用sorted函数.但是sorted函数用在字 ...

  8. centos安装配置amoeba以及测试

    一.amoeba介绍网址:http://docs.hexnova.com/amoeba/ 二.安装java se1.5 三.安装amoeba2.2.01.下载地址:http://sourceforge ...

  9. Thinking in Java——笔记(1)

    Introduction To Obejct The progress of abstraction But their primary abstraction still requires you ...

  10. LeetCode Generalized Abbreviation

    原题链接在这里:https://leetcode.com/problems/generalized-abbreviation/ 题目: Write a function to generate the ...