jquery form selectors include: ":input", ":button", ":checkbox", ":file", ":hidden", ":image", ":password", ":radio" ”, “:reset”, “:submit”, “:text”.
[Related recommendations: jQuery video tutorial]
The form selector matches elements that often appear in the form . But the matching elements are not necessarily in the form
:input
Description: Match all input elements
Example:
$(":input") //匹配所有input元素 $("form :input") //匹配<form>标记中所有input元素,需要注意,在form和:之间有一个空格
:button
Description: Match all ordinary buttons, that is, input elements of type="button"
Example :
$(":button") //匹配所有的普通按钮
:checkbox
Description: Match all checkboxes
Example:
$(":checkbox") //匹配所有的复选框
:file
Description: Match all file fields
Example:
$(":file") //匹配所有的文件域
: hidden
Description: Match all invisible elements, or elements of type hidden
Example:
$(":hidden") //匹配所有的隐藏域
: image
Description: Match all image fields
Example:
$(":image") //匹配所有图像域
:password
Description: Match all password fields
Example:
$(":password") //匹配所有密码域
:radio
Description: Match all single Select button
Example:
$(":radio") //匹配所有单选按钮
:reset
Description: Match all reset buttons, that is, type=" reset" input element
Example:
$(":reset") //匹配所有的重置按钮
:submit
Description: Match all submit buttons, that is, type Input element
of ="submit" Example:
$(":submit") //匹配所有的提交按钮
:text
Description: Match all single-line text boxes
Example:
$(":text") //匹配所有的单行文本框
For more programming-related knowledge, please visit: Introduction to Programming! !
The above is the detailed content of What form selectors does jquery have?. For more information, please follow other related articles on the PHP Chinese website!