How to check which class was added in Ajax after adding it?

I have Ajax functions where sometimes I am adding class called red to a radio button using this code:
$("#checklocalemail").addClass("green");
or
$("#checklocalemail").addClass("red");
I want to verify later what is the last class is add, but how can I retrieve that?
I have checked anf I found that this can be used by .find () but it is not clear to me how to use it, as I can not find much examples for it, can someone help please?

The .hasClass() method will return true if the class is assigned to an element, even if other classes also are. For example, given the HTML above, the following will return true:
$( "#mydiv" ).hasClass(

The viewer will learn the basics of jQuery, including how to invoke it on a web page.
Reference your jQuery libraries: (CODE)
Include your new external js/jQuery file: (CODE)
Write your first lines of code to setup your site for jQuery.: (CODE)