返回值:jQueryremoveClass(function(index, class))
概述
從所有匹配的元素中刪除全部或者指定的類。
參數
function(index, class)Function
此函數必須返回一個或多個空格分隔的class名。接受兩個參數,index參數為對象在這個集合中的索引值,class參數為這個對象原先的class屬性值。
示例
描述:
刪除最后一個元素上與前面重復的class
jQuery 代碼:
$('li:last').removeClass(function() {
return $(this).prev().attr('class');
});