Javascript / Jquery hasclass not working : Im learning Jquery and Im trying to check if a div has a certain class, this is the div in question:

    <span class="recaptcha-checkbox goog-inline-block recaptcha-checkbox-unchecked recaptcha-checkbox-checked rc-anchor-checkbox recaptcha-checkbox-expired" role="checkbox" aria-checked="false" id="recaptcha-anchor" tabindex="0" dir="ltr" aria-labelledby="recaptcha-anchor-label"><div class="recaptcha-checkbox-border" role="presentation" style=""></div><div class="recaptcha-checkbox-borderAnimation" role="presentation" style=""></div><div class="recaptcha-checkbox-spinner" role="presentation"></div><div class="recaptcha-checkbox-spinnerAnimation" role="presentation"></div><div class="recaptcha-checkbox-checkmark" role="presentation"></div></span>

The idea is to check if the `<span>` have the class `recaptcha-checkbox-checked`

So in regards of the documentation https://api.jquery.com/hasclass/

*"The .hasClass() method will return true if the class is assigned to an element, even if other classes also are."*

So I have the following:

    captchaStatus: function () {
        return $("#recaptcha-anchor").hasClass("recaptcha-checkbox-checked")
    
    }

It is always returning false even if the element have the class.