admin管理员组文章数量:1417408
How can you check the value of aria-invalid in an input form?
Here's my input field and the value of aria-invalid is false:
<input type="email" name="your-email" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email" id="contact-email" aria-required="true" aria-invalid="false" placeholder="Email *">
I need to identify the aria-invalid if it's true or false. Here's my javascript for identifying this and I'm having a difficulty
<script>
$(document).ready(function(){
var input_email = document.getElementById("contact-email");
});
Help with this please thanks!
How can you check the value of aria-invalid in an input form?
Here's my input field and the value of aria-invalid is false:
<input type="email" name="your-email" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email" id="contact-email" aria-required="true" aria-invalid="false" placeholder="Email *">
I need to identify the aria-invalid if it's true or false. Here's my javascript for identifying this and I'm having a difficulty
<script>
$(document).ready(function(){
var input_email = document.getElementById("contact-email");
});
Help with this please thanks!
Share Improve this question asked May 16, 2018 at 1:03 Jae EunJae Eun 573 silver badges15 bronze badges1 Answer
Reset to default 4Use getAttribute()
to get the value of attributes, in your case aria-invalid
document.getElementById("contact-email").getAttribute("aria-invalid")
本文标签: javascriptHow to check AriaInvalid in an Input FormStack Overflow
版权声明:本文标题:javascript - How to check Aria-Invalid in an Input Form - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745262011a2650397.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论