2018-10-10 18:03:03 -04:00
---
id: bad87fee1348bd9aec908852
2021-02-06 04:42:36 +00:00
title: Create a Class to Target with jQuery Selectors
2018-10-10 18:03:03 -04:00
challengeType: 0
2020-09-07 16:17:39 +08:00
forumTopicId: 16815
2021-01-13 03:31:00 +01:00
dashedName: create-a-class-to-target-with-jquery-selectors
2018-10-10 18:03:03 -04:00
---
2020-12-16 00:37:30 -07:00
# --description--
2020-09-07 16:17:39 +08:00
2021-02-06 04:42:36 +00:00
Not every class needs to have corresponding CSS. Sometimes we create classes just for the purpose of selecting these elements more easily using jQuery.
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
Give each of your `button` elements the class `target` .
2018-10-10 18:03:03 -04:00
2020-12-16 00:37:30 -07:00
# --hints--
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
You should apply the `target` class to each of your `button` elements.
2018-10-10 18:03:03 -04:00
2020-12-16 00:37:30 -07:00
```js
assert($('.target').length > 5);
2018-10-10 18:03:03 -04:00
```
2021-01-13 03:31:00 +01:00
# --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 >
```
2020-12-16 00:37:30 -07:00
# --solutions--
2020-08-13 17:24:35 +02:00
2021-01-13 03:31:00 +01:00
```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 >
```