Jquery – Is this an example of selectors


I see the following piece of code


What does this code do. Which feature of jquery is this? Is this selector example? Any links to read more on it?

Best Solution

That exact piece of code is not a valid selector, but if you split them up they are filters and they are used to make a selector.

$('input[type="button"]') // references <input type=button>

The others are just filters denoted by the colon.

:text //matches all input type=text
:visible //*tries* to return what elements are visible
:enabled //matches elements that are enabled
:first //grabs the first in the selector set.

Usage: $('el:visible')

Reference: http://docs.jquery.com/Selectors