2010-06-04 92 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