Bug in jQquery adding/removing HTML elements, 6th part


#1

I think there's a bug on this level. It asks for me to add the #text div to the .highlighted class.

It's definitely not my code, after many different tweaks. I copied/pasted the js from the 7th part, let alone from the hint...which doesn't validate either.

$(document).ready(function() {
$('div').click(function() {
$('text').addClass('highlighted');
});
});

Error Message: Oops, try again. Please follow the instructions on the Full Preview page to test your code.

Would you mind getting on this issue, please?


#2

@b.giulini

Hi,

I don't think it is a bug

Your text should have a # before it, right? We are selecting an id.


#3


Even when I include the point sign and period, it just gives me the message; t looks like your #text doesn't have the class .highlighted. Check the Hint if you need help!

EDIT: I realized you need the pound sign but NOT the period, but the directions say differently. I'd at least like to bring this to someone's attention, since the misleading directions got me stuck on this one for a while.


#4

Hi,

For the click function you need to select #text not div

and then below you need to select this


#5

While this definitely isn't a bug, I'm afraid you're getting caught up in petty technicalities. Regardless of what code is right or wrong by this point, it's clear the instructions are a little confusing and led me to an incorrect response.


#6

Okay, Thank you will have a look at the instructions again :slight_smile:


#7

This topic was automatically closed after 2 hours. New replies are no longer allowed.