6.Adding and Removing Classes


#1

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

Also having trouble. I have tied myself in knots


"Adding and Removing Classes" DOESNT WORK, WHY?
#2

@willbakerman

Hi,

The highlighted part is an HTML element, a class or an id?


#3

You sir are a life saver :sunglasses:


#4

you have it mixed up,

You need to have .click for #text as you want to add highlighted when the div with the id text is clicked on..

Get it ?

So you need to add the class highlighted not text


#5

Yes! and the other problem was that I wrote a "c" for Class and not a "C"


#9