Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different of input start with colon and without colon

Tags:

jquery

What is the different between

$("input[name='ABC']") // without ":"
$(":input[name='ABC']") // with ":"

both work same to me, so should we write it with colon ":" or without? which is more correct?

like image 853
user1493339 Avatar asked Sep 05 '12 17:09

user1493339


1 Answers

input will just select specifically the <input> element.

:input selects <input>, <textarea>, <select>, and <button>.

like image 177
Explosion Pills Avatar answered Oct 17 '22 17:10

Explosion Pills