button
? Los seleccionamos con $("button")
, luego les agregamos algunas clases de CSS con .addClass("animated bounce");
. Acabas de usar la función .addClass()
de jQuery, que permite agregar clases a los elementos. En primer lugar, vamos a orientar los div
elementos con la clase well
mediante el uso de el $(".well")
selector. Ten en cuenta que, al igual que con las declaraciones de CSS, se escribe un .
antes del nombre de la clase. Luego usa la función .addClass()
de jQuery para agregar las clases animated
y shake
. Por ejemplo, puedes hacer que todos los elementos con la clase text-primary
se sacudan agregando lo siguiente a su document ready function
: $(".text-primary").addClass("animated shake");
addClass()
la función de dar las clases animated
y shake
a todos sus elementos con la clase well
.
testString: 'assert($(".well").hasClass("animated") && $(".well").hasClass("shake"), "Use the jQuery addClass()
function to give the classes animated
and shake
to all your elements with the class well
.");'
- text: Solo use jQuery para agregar estas clases al elemento.
testString: 'assert(!code.match(/class\.\*animated/g), "Only use jQuery to add these classes to the element.");'
```