2010-06-04 61 views
1

你能解释下面的选择器是什么意思吗?选择器的含义是什么?

$( “输入:checkbox.compbox”)

谢谢。

+0

http://api.jquery.com/category/selectors/ – Reigel 2010-06-04 03:44:27

回答

6

它在寻找这样的元件:

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

它寻找三两件事:

  • 的输入单元类型,<input />
  • 具体地说,type="checkbox"输入
  • 的元件与一类compbox

由于选择器没有空格,因此它会查找符合所有三个条件的个别元素,而不是子/后代或类似的任何元素。有关其他信息,请参阅you can find a full list of selectors herea great getting started guide herea video tutorial on selectors here

+0

感谢您的解释。 – Ricky 2010-06-04 03:50:35