72 lines
1.8 KiB
Markdown
72 lines
1.8 KiB
Markdown
---
|
|
id: bad87fee1348bd9aec908852
|
|
title: Create a Class to Target with jQuery Selectors
|
|
challengeType: 0
|
|
forumTopicId: 16815
|
|
dashedName: create-a-class-to-target-with-jquery-selectors
|
|
---
|
|
|
|
# --description--
|
|
|
|
Not every class needs to have corresponding CSS. Sometimes we create classes just for the purpose of selecting these elements more easily using jQuery.
|
|
|
|
Give each of your `button` elements the class `target`.
|
|
|
|
# --hints--
|
|
|
|
You should apply the `target` class to each of your `button` elements.
|
|
|
|
```js
|
|
assert($('.target').length > 5);
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --seed-contents--
|
|
|
|
```html
|
|
<div class="container-fluid">
|
|
<h3 class="text-primary text-center">jQuery Playground</h3>
|
|
<div class="row">
|
|
<div class="col-xs-6">
|
|
<div class="well">
|
|
<button class="btn btn-default"></button>
|
|
<button class="btn btn-default"></button>
|
|
<button class="btn btn-default"></button>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-6">
|
|
<div class="well">
|
|
<button class="btn btn-default"></button>
|
|
<button class="btn btn-default"></button>
|
|
<button class="btn btn-default"></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
```
|
|
|
|
# --solutions--
|
|
|
|
```html
|
|
<div class="container-fluid">
|
|
<h3 class="text-primary text-center">jQuery Playground</h3>
|
|
<div class="row">
|
|
<div class="col-xs-6">
|
|
<div class="well">
|
|
<button class="target btn btn-default"></button>
|
|
<button class="target btn btn-default"></button>
|
|
<button class="target btn btn-default"></button>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-6">
|
|
<div class="well">
|
|
<button class="target btn btn-default"></button>
|
|
<button class="target btn btn-default"></button>
|
|
<button class="target btn btn-default"></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
```
|