Files
freeCodeCamp/curriculum/challenges/chinese/03-front-end-libraries/bootstrap/create-a-class-to-target-with-jquery-selectors.md

24 lines
508 B
Markdown
Raw Normal View History

---
id: bad87fee1348bd9aec908852
title: 分别给每个目标元素的 class 属性添加一个 target 值
challengeType: 0
forumTopicId: 16815
---
# --description--
并不是所有 class 属性都需要有对应的 CSS 样式。有时候我们设置 class 只是为了更方便地在 jQuery 中选中这些元素。
为每一个 `button` 元素添加 `target` class。
# --hints--
给你的每一个 `button` 元素设置 `target` class。
```js
assert($('.target').length > 5);
```
# --solutions--