Input vs :Input in jQuery

前端 未结 3 2053
清歌不尽
清歌不尽 2021-02-13 11:43

I wonder why people seems to prefer :input over input as a jQuery selector? Basically, this two lines seem to do the same thing :

$(\'i         


        
3条回答
  •  轮回少年
    2021-02-13 12:11

    :input selects all input, textarea, select and button elements, while input just selects elements with an input tag.

提交回复
热议问题