<sectionid="description"> Cada elemento HTML tiene un elemento <code>parent</code> del cual <code>inherits</code> propiedades. Por ejemplo, su elemento <code>jQuery Playground</code><code>h3</code> tiene el elemento principal de <code><div class="container-fluid"></code> , que a su vez tiene el <code>body</code> principal. jQuery tiene una función llamada <code>parent()</code> que le permite acceder al padre de cualquier elemento que haya seleccionado. Este es un ejemplo de cómo usaría la función <code>parent()</code> si quisiera darle al elemento padre del elemento del <code>left-well</code> un color de fondo azul: <code>$("#left-well").parent().css("background-color", "blue")</code><code>#target1</code> al padre del elemento <code>#target1</code> un color de fondo rojo. </section>
testString: 'assert(code.match(/\.parent\s*\(\s*\)\s*\.css/g), "You should use the <code>.parent()</code> function to modify this element.");'
testString: 'assert(code.match(/\$\s*?\(\s*?(?:"|")\s*?#target1\s*?(?:"|")\s*?\)\s*?\.parent/gi), "The <code>.parent()</code> method should be called on the <code>#target1</code> element.");'
- text: Solo use jQuery para agregar estas clases al elemento.
testString: 'assert(code.match(/<divclass="well"id="left-well">/g), "Only use jQuery to add these classes to the element.");'