<sectionid="description"> Ahora tenemos una <code>document ready function</code> . Ahora vamos a escribir nuestra primera declaración jQuery. Todas las funciones de jQuery comienzan con un <code>$</code> , generalmente conocido como <code>dollar sign operator</code> , o como <code>bling</code> . jQuery a menudo selecciona un elemento HTML con un <code>selector</code> , luego le hace algo a ese elemento. Por ejemplo, hagamos que todos los elementos de tus <code>button</code> reboten. Solo agregue este código dentro de su función de documento listo: <code>$("button").addClass("animated bounce");</code> Tenga en cuenta que ya hemos incluido la biblioteca jQuery y la biblioteca Animate.css en segundo plano para que pueda usarlas en el editor. Así que estás utilizando jQuery para aplicar la clase de <code>bounce</code> Animate.css a los elementos de tu <code>button</code> . </section>
- text: Use la función jQuery <code>addClass()</code> para dar a las clases <code>animated</code> y <code>bounce</code> en los elementos de sus <code>button</code> .
testString: 'assert($("button").hasClass("animated") && $("button").hasClass("bounce"), "Use the jQuery <code>addClass()</code> function to give the classes <code>animated</code> and <code>bounce</code> to your <code>button</code> elements.");'
- text: Solo use jQuery para agregar estos colores al elemento.
testString: 'assert(!code.match(/class.*animated/g), "Only use jQuery to add these colors to the element.");'
- text: Su código jQuery debe estar dentro de <code>$(document).ready();</code> función.
testString: 'assert(code.match(/\$\(document\)\.ready\(function.*(\s|\n)*.*button.*.addClass.*\);/g), "Your jQuery code should be within the <code>$(document).ready();</code> function.");'