Adding and Removing Classes


#1

Hi, can anyone help me with the code? I keep receiving error messages

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


#2

Hi petr, the issue you're having is in your indentation. take a look at line 2, 3, and 4. Generally, line 2 should be aligned with 1, then line 3 only needs one indentation in from those two. Finally, line 4 should be aligned with 3. Hope this helps!


#3

Thanks a lot, but I have already solved the problem by removing the last semicolon


#4

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