6/14 Adding and Removing Classes?


#1

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

Oops, try again. It looks like your #text doesn't have the class .highlighted. Check the Hint if you need help!


#2

Hi Telos,

Take a close look at your code:

.text

versus the error message you're getting:

#text

Can you spot the problem now?

Hint

You need to select $('#text'), with a hash sign (#), rather than $('.text'), with a dot (.) on line 2 :slight_smile:


#4

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.