jquery中通过添加readonly或者disabled属性实现行为禁止 / 去除某个属性的方法
<!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属性实现行为禁止 / 去除某个属性的方法的更多相关文章
- JQuery控制input的readonly和disabled属性
jquery设置元素的readonly和disabled Jquery的api中提供了对元素应用disabled和readonly属性的方法,在这里记录下.如下: 1.readonly $('in ...
- jquery设置元素的readonly和disabled
jquery设置元素的readonly和disabled Jquery的api中提供了对元素应用disabled和readonly属性的方法,在这里记录下.如下: $( '#line2Tr' ).cs ...
- jQuery中怎么添加innerText、innerHtml(转)
发现如果我在div或者其他非表单的标签中赋值,原本用普通的js就直接document.getElementById("id").innerHtml(或者其他几个)就可以了. 但是在 ...
- jQuery设置元素的readonly和disabled属性
jQuery的api中提供了对元素应用disabled和readonly属性的方法,如下: 1.readonly $('input').attr("readonly",&qu ...
- jquery设置元素的readonly和disabled【转】
Jquery的api中提供了对元素应用disabled和readonly属性的方法,在这里记录下.如下: 1.readonly $('input').attr("readonly&qu ...
- jquery中动态添加的标签绑定的click事件失效的解决办法
把.click()换成.live('click',function(){})(如果你的jquery的版本是1.10之前) 把.click()换成.on('click',function(){})(jq ...
- 在js或jquery中动态添加js脚本【转】
起因: 我们在用js动态写入script时,会导致</script>后面的所有语句都变为普通文本,导致html展示无效, 所以我们需要规避</script>问题. 解决方案一( ...
- jQuery中判断input的disabled属性
<input type="text" id="ipt1" disabled> <input type="text" id= ...
- jquery 将disabled的元素置为enabled的三种方法
转--http://www.jb51.net/article/19342.htm 在jquery中可以通过jqueryObj.attr("disabled","disab ...
随机推荐
- HBase实验(CRUD和MR入库)
目录 前期准备 在HBase shell中实现CRUD操作 1. 启动命令行客户端 2. 创建表 3. 删除.新增列族 4. 删除表teacher 5. 新增数据 6. 查看数据 用Java API实 ...
- 131. Palindrome Partitioning (Back-Track, DP)
Given a string s, partition s such that every substring of the partition is a palindrome. Return all ...
- Oracle_in_not-in_distinct_minsu的用法
create table a( id int, username ) ); create table b( id int, username ) ); ,'小明'); ,'小红'); ,'小君'); ...
- Common issue on financial information exchange (FIX) Connectivity[z]
FIX Protocol Session Connectivity Hi guys, in this post I would like share my experience with financ ...
- [SQL]查询数据库中具有某个字段名的表
SELECT t.name AS table_name, c.name AS column_name FROM XOIFundData.sys.tables AS t INNER JOIN XOIFu ...
- JVM 垃圾回收- 转载 知识碎片
最近关注了一下垃圾回收的问题,想了解一下JVM 关于方法区的垃圾回收机制,找了几篇文章,不同的文章从不同角度讲述了一下,嗯... 拼凑起来 记录一下, 有些未验证正确性... JVM 方法区 当JVM ...
- xml数据改动
public void reXml ( string namepngname ) { XmlDocument doc = new XmlDocument(); doc.Load(_xmlpath); ...
- 使用Nmap攻击靶机和使用Wireshark进行嗅探、分析
使用Nmap攻击靶机和使用Wireshark进行嗅探.分析 在上一次课中已经对Nmap的使用.原理已经做了很多学习,这次的课更多地针对Wireshark进行学习和使用. 使用192.168.200.1 ...
- polymer-developer guide-feature overview
<dom-module id='proto-element'> <template> <div>{{greeting}}</div> </temp ...
- [label][HTML5-APP]通过使用HTML5特性开发WebApp的Framework收集
1. jQuery mobile http://jquerymobile.com 2. Intel's App Framework http://app-framework-software.in ...