APD Toronto
asked on
this.hasClass is not a function
Hi Experts,
I have the following code
With which I am trying to determine if the cliked element has the class fa-caret-right, but I am getting the following error
Any help will be greatly appreciated.
I have the following code
$(document).ready(function(){
//expand/collapse detail data
$('.spMobile').on('click', function(){
var expand = this.hasClass('fa-caret-right');
});
});//document ready
With which I am trying to determine if the cliked element has the class fa-caret-right, but I am getting the following error
VM3768 functions.js:6 Uncaught TypeError: this.hasClass is not a function
at HTMLSpanElement.<anonymous> (VM3768 functions.js:6)
at HTMLSpanElement.dispatch (jquery-3.2.1.js:5206)
at HTMLSpanElement.elemData.handle (jquery-3.2.1.js:5014)
Any help will be greatly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.