确定元素是否是一个表单域 [英] Determine if an element is a form field
本文介绍了确定元素是否是一个表单域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
任何方便的方法来确定所选元素是否是一个表单域, p>您可以使用 .is(':input')
来测试它是否是任何形式的元素。
Docrefs:
- http:// api。 jquery.com/is/ - 根据选择器检查当前匹配的元素集
- http://api.jquery.com/input-selector/ - 选择所有输入,textarea,select和button元素。
Any convenient ways to determine if a selected element is a form field, i.e is an input, select, checkbox etc?
解决方案
You can use .is(':input')
to test if it's any kind of form element.
Docrefs:
- http://api.jquery.com/is/ - Check the current matched set of elements against a selector...
- http://api.jquery.com/input-selector/ - Selects all input, textarea, select and button elements."
这篇关于确定元素是否是一个表单域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文