JQuery Agregar y eliminar clases


#1

https://www.codecademy.com/es/courses/web-beginner-en-6LN6G/1/1?curriculum_id=51226bebc261a8bdd4000ab5#

Hola. no sé que estoy haciendo mal, pero no tengo modo de terminar el ejercicio. A ver si alguien puede ayudarme.


$(document).ready(function(){
    $("#texto").click(function(){
        $("this").addClass(".resaltar");
    });
});
    


#2
$(this)

this is an object.


#3

Thanks, bun I haven´t got to solve it.

I have introduce this:

$(document).ready(function(){
$("#texto").click(function(){
$(this).addClass(".resaltar");
});
});


#4

I currently have solve it with this code:

$(this).addClass**("resaltar");**

I am going to continue it.

Thank you.


#5

So you discovered the other mistake, the dot. When the method is directly aimed at a class attribute, the dot is not part of the name.