--- id: bad87fee1348bd9aed308826 title: Target the Parent of an Element Using jQuery challengeType: 6 videoUrl: '' localeTitle: Apunta al padre de un elemento usando jQuery --- ## Description
Cada elemento HTML tiene un elemento parent del cual inherits propiedades. Por ejemplo, su elemento jQuery Playground h3 tiene el elemento principal de <div class="container-fluid"> , que a su vez tiene el body principal. jQuery tiene una función llamada parent() que le permite acceder al padre de cualquier elemento que haya seleccionado. Este es un ejemplo de cómo usaría la función parent() si quisiera darle al elemento padre del elemento del left-well un color de fondo azul: $("#left-well").parent().css("background-color", "blue") #target1 al padre del elemento #target1 un color de fondo rojo.
## Instructions
## Tests
```yml tests: - text: Su elemento de left-well debe tener un fondo rojo. testString: 'assert($("#left-well").css("background-color") === "red" || $("#left-well").css("background-color") === "rgb(255, 0, 0)" || $("#left-well").css("background-color").toLowerCase() === "#ff0000" || $("#left-well").css("background-color").toLowerCase() === "#f00", "Your left-well element should have a red background.");' - text: Debe usar la función .parent() para modificar este elemento. testString: 'assert(code.match(/\.parent\s*\(\s*\)\s*\.css/g), "You should use the .parent() function to modify this element.");' - text: 'El método .parent() debe llamarse en el elemento #target1 .' testString: 'assert(code.match(/\$\s*?\(\s*?(?:"|")\s*?#target1\s*?(?:"|")\s*?\)\s*?\.parent/gi), "The .parent() method should be called on the #target1 element.");' - text: Solo use jQuery para agregar estas clases al elemento. testString: 'assert(code.match(/
/g), "Only use jQuery to add these classes to the element.");' ```
## Challenge Seed
```html

jQuery Playground

#left-well

#right-well

```
## Solution
```js // solution required ```