--- id: bad87fee1348bd9aec908852 title: 用 jQuery 選擇器給目標元素的添加 class challengeType: 0 forumTopicId: 16815 dashedName: create-a-class-to-target-with-jquery-selectors --- # --description-- 並不是所有 class 屬性都需要有對應的 CSS 樣式。 有時候我們設置 class 只是爲了更方便地在 jQuery 中選中這些元素。 爲每一個 `button` 元素添加 `target` class。 # --hints-- 每一個 `button` 元素都應該設置 `target` class ```js assert($('.target').length > 5); ``` # --seed-- ## --seed-contents-- ```html

jQuery Playground

``` # --solutions-- ```html

jQuery Playground

```