How to turn an element into a jQuery selector?

How to turn event.currentTarget into a jQuery object or something like that so that I can then use the jQuery addClass method for the object? I know I can just do: event.currentTarget.className + = '.class', but I was wondering how to work with the target using jQuery.

$('.class').click(function(event) { Class.down($(this).parent().prev().attr('alt')); Class.style($(event.currentTarget)); }); 
+4
source share
1 answer
 $(event.currentTarget).addClass("classname"); 
+11
source

Source: https://habr.com/ru/post/1336038/


All Articles