<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ajax file</title>
<script src="./js/jquery-1.12.4.min.js"></script>
<script>
$(function(){
// 设置禁止点击
$(".butt").attr("disabled","disabled")
$(".ck").attr('readonly',"readonly")
// 去除某个属性
$(".buu").removeAttr("disabled")
});
</script>
</head>
<body>
<div class="box" a="">
嘿嘿
</div>
<input class="ck" type="text" value="嘿嘿">
<button class='butt'>按钮</button>
<button class='buu' disabled="disabled">按钮2</button>
</body>
</html>

jquery中通过添加readonly或者disabled属性实现行为禁止 / 去除某个属性的方法的更多相关文章

  1. JQuery控制input的readonly和disabled属性

    jquery设置元素的readonly和disabled Jquery的api中提供了对元素应用disabled和readonly属性的方法,在这里记录下.如下: 1.readonly   $('in ...

  2. jquery设置元素的readonly和disabled

    jquery设置元素的readonly和disabled Jquery的api中提供了对元素应用disabled和readonly属性的方法,在这里记录下.如下: $( '#line2Tr' ).cs ...

  3. jQuery中怎么添加innerText、innerHtml(转)

    发现如果我在div或者其他非表单的标签中赋值,原本用普通的js就直接document.getElementById("id").innerHtml(或者其他几个)就可以了. 但是在 ...

  4. jQuery设置元素的readonly和disabled属性

    jQuery的api中提供了对元素应用disabled和readonly属性的方法,如下: 1.readonly    $('input').attr("readonly",&qu ...

  5. jquery设置元素的readonly和disabled【转】

    Jquery的api中提供了对元素应用disabled和readonly属性的方法,在这里记录下.如下: 1.readonly    $('input').attr("readonly&qu ...

  6. jquery中动态添加的标签绑定的click事件失效的解决办法

    把.click()换成.live('click',function(){})(如果你的jquery的版本是1.10之前) 把.click()换成.on('click',function(){})(jq ...

  7. 在js或jquery中动态添加js脚本【转】

    起因: 我们在用js动态写入script时,会导致</script>后面的所有语句都变为普通文本,导致html展示无效, 所以我们需要规避</script>问题. 解决方案一( ...

  8. jQuery中判断input的disabled属性

    <input type="text" id="ipt1" disabled> <input type="text" id= ...

  9. jquery 将disabled的元素置为enabled的三种方法

    转--http://www.jb51.net/article/19342.htm 在jquery中可以通过jqueryObj.attr("disabled","disab ...

随机推荐

  1. InfoPanel

    [InfoPanel] The Info panel shows the color values beneath the pointer and, depending on the tool in ...

  2. lammps模拟化学反应(1)

    1. Can I use lammps to chemical reaction systems?Please note that you can only get as good an answer ...

  3. JS 将json数组转为嵌套层级数组

    ele UI 的树级菜单的数据要求是这种嵌套的,但是Ztree的老用发的是 var zNodes =[ { id:, pId:, name:"zTree Home", pid:0} ...

  4. params must be [a-zA-Z0-9] for verification sms

    阿里短信发送短信时返回这个信息,之前是可以发送的,现在阿里应该是做了限制的.如果你的短信模板类型为“验证码”,发送的短信内容只能是包含字母和数字 所以当你的短信内容包含特殊符号和中文时,请把短信模板类 ...

  5. jsp页面拨打电话和QQ聊天

    拨打电话: <a href="tel:手机号">拨打电话</a> 这种方式塞班.安卓与iphone都支持. 参考文章:https://blog.csdn.n ...

  6. CMDB之数据采集

    一. 四种方式 1. Agent方式 api - URL - 发送数据格式 - 返回值 agent - 采集数据,发送数据 好处: - 简单 - 采集速度快,响应速度快 坏处: - 每台agent装的 ...

  7. ForwardPriceSimulationService

    using System;using System.Collections.Generic;using System.Linq;using System.Text; using System.Coll ...

  8. sqlserver2012 清除日志

    1. backup log wwgl_demo to disk='D:\DATA_BACKUP\2017-07-19.log' 2. 右键数据库-->任务-->收缩-->文件     ...

  9. linux平台使用spark-submit以cluster模式提交spark应用到standalone集群

    shell脚本如下 sparkHome=/home/spark/spark-2.2.0-bin-hadoop2.7 $sparkHome/bin/spark-submit \ --class stre ...

  10. VS2017设置默认管理员权限启动

    找到vs安装目录下的:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe 右键- ...