anam anam - 1 year ago 156
jQuery Question

Remove All classes From Div

is there any way to Remove All classes From div ... on click of image i want to remove all the classes from it .

Please Help,

$(document).ready(function () {
var pos=$('img', this).attr('alt');
alert('i am imageFlip'+this.alt);

console.log('i am Image Flip');
var t = $(this);


Here in my code i want to remove all classes from $(this).

Thanks and Regards,

Answer Source

You don't need to wrap this in a jQuery selector to complete this job.

To remove all classes from the element

this.className = '';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download