2021-06-15 00:49:18 -07:00
---
id: bad87fee1348bd9aec908852
2021-06-26 21:42:30 +05:30
title: Creare una classe da usare con i selettori jQuery
2021-06-15 00:49:18 -07:00
challengeType: 0
forumTopicId: 16815
dashedName: create-a-class-to-target-with-jquery-selectors
---
# --description--
2021-06-26 21:42:30 +05:30
Non tutte le classi devono avere un corrispondente CSS. A volte creeremo delle classi solo allo scopo di selezionare questi elementi più facilmente utilizzando jQuery.
2021-06-15 00:49:18 -07:00
2021-06-26 21:42:30 +05:30
Assegna a ciascuno dei tuoi elementi `button` la classe `target` .
2021-06-15 00:49:18 -07:00
# --hints--
2021-06-26 21:42:30 +05:30
Dovresti applicare la classe `target` a ciascuno dei tuoi elementi `button` .
2021-06-15 00:49:18 -07:00
```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 >
```