How to remove all CSS classes from an element using JQuery

Waqas Anwar
26 August 2014
4540 Views

There are many solutions to remove all CSS classes from an element using JQuery as shown below:

$("#item").removeClass();
$("#item").removeAttr('class');
$("#item").attr('class', '');
$('#item')[0].className = '';

If you didn't have jQuery, then you can use following solution:
document.getElementById('item').className = '';