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年前关闭。
            
                    
我看过选择input的两种方法:

$("input")




$(":input")


它们之间有什么区别吗?

最佳答案

$("input")仅选择<input>元素。

$(":input")jQuery extension,将选择以下元素:<input><select><textarea><button>

Example

09-26 21:54
查看更多