$("#item").removeClass();
Calling removeClass
with no parameters will remove all of the item's classes.
(调用不带参数的removeClass
将删除所有项的类。)
You can also use (but is not necessarily recommended, the correct way is the one above):
(您也可以使用(但不一定推荐, 正确的方法是上面的方法):)
$("#item").removeAttr('class');
$("#item").attr('class', '');
$('#item')[0].className = '';
If you didn't have jQuery, then this would be pretty much your only option:
(如果你没有jQuery,那么这将是你唯一的选择:)
document.getElementById('item').className = '';
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…