tags:

views:

42

answers:

1

Hi all:

Can you explain what the following selector mean?

$("input:checkbox.compbox")

Thank you.

+6  A: 

It's looking for elements like this:

<input type="checkbox" class="compbox" />

It's looking for three things:

  • An input element type, <input />
  • Specifically, a type="checkbox" input
  • An element with a class of compbox

Since the selector has no spaces, it's look for individual elements that meets all three criteria, not children/descendants or anything like that. For additional info, you can find a full list of selectors here, a great getting started guide here and a video tutorial on selectors here.

Nick Craver
Thanks for the explanation.
Ricky