This question already has answers here:
What's the purpose of a leading colon in a jQuery selector?
(3个答案)
Input vs :Input in jQuery
(3个答案)
6年前关闭。
我看过选择
和
它们之间有什么区别吗?
(3个答案)
Input vs :Input in jQuery
(3个答案)
6年前关闭。
我看过选择
input
的两种方法:$("input")
和
$(":input")
它们之间有什么区别吗?
最佳答案
$("input")
仅选择<input>
元素。$(":input")
是jQuery extension,将选择以下元素:<input>
,<select>
,<textarea>
和<button>
Example