Freecodecamp: Your left-well element should have a red background - it does but i can't pass

Created on 17 Aug 2015  ·  3Comments  ·  Source: freeCodeCamp/freeCodeCamp

Challenge http://www.freecodecamp.com/challenges/waypoint-target-the-parent-of-an-element-using-jquery has an issue. Please describe how to reproduce it, and include links to screenshots if possible.

image

Most helpful comment

This is not a bug.

In your code you are targeting the PARENT of the div with the ID left-well. Thus, you are targeting the div with the class col-xs-6.

Since you're targeting the left-well ID using the parent() selector, you'd want to target one of the children within that ID.

For example, the code:

$("#target1").parent().css("background-color", "red")

should (and does) work. Hope this helps.

All 3 comments

This is not a bug.

In your code you are targeting the PARENT of the div with the ID left-well. Thus, you are targeting the div with the class col-xs-6.

Since you're targeting the left-well ID using the parent() selector, you'd want to target one of the children within that ID.

For example, the code:

$("#target1").parent().css("background-color", "red")

should (and does) work. Hope this helps.

thanks for the help

Correct Answer is,

$("#left-well").css("background-color","red");
$('#target1').parent().css('background-color','red');

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichaelLeeHobbs picture MichaelLeeHobbs  ·  3Comments

bagrounds picture bagrounds  ·  3Comments

Akshit-p picture Akshit-p  ·  3Comments

robwelan picture robwelan  ·  3Comments

SaintPeter picture SaintPeter  ·  3Comments