I have tried running the code below to no success please someone kindly help i cant see any error but its not running


#1



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


#2

Write $('#text') instead of $('text') :slight_smile:


#3

i tried everything but still there is an error of which i dont see


#4

Refresh the page, then write the code.

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

#5

well...i have refreshed and wrote the code all over again still no success


#6

is yours code working


#7

Yes, it is.

If you write this code without changing anything in the html and css code, it must work.


#8

@chieth Could you please post a link to the exercise you're on?