--- 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

```