jQuery的要求去除的HTML5属性 [英] jquery removing html5 required attribute
本文介绍了jQuery的要求去除的HTML5属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我想用jQuery删除所必需的'='属性。
<输入
TYPE =文本
ID =编辑提交-直呼其名
NAME =提交[FIRST_NAME]
值=
大小=30
MAXLENGTH =128
要求=
>
解决方案
刚:
$('#编辑提交-直呼其名')removeAttr('需要');
如果您有兴趣进一步阅读这里看看。
Hi I would like to remove the 'required=""' attribute with jquery.
<input
type="text"
id="edit-submitted-first-name"
name="submitted[first_name]"
value=""
size="30"
maxlength="128"
required=""
>
解决方案
Just:
$('#edit-submitted-first-name').removeAttr('required');
If you're interested in further reading take a look here.
这篇关于jQuery的要求去除的HTML5属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文