button
? Los seleccionamos con $("button")
, luego les agregamos algunas clases de CSS con .addClass("animated bounce");
. Acaba de usar la función .addClass()
jQuery, que le permite agregar clases a los elementos. En primer lugar, vamos a orientar su div
elementos con la clase well
mediante el uso de la $(".well")
selector. Tenga en cuenta que, al igual que con las declaraciones de CSS, escribe a .
antes del nombre de la clase. Luego use la función .addClass()
jQuery para agregar las clases animated
y shake
. Por ejemplo, puede hacer que todos los elementos con la clase text-primary
shake 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.");'
```