我有以下html:
<div class="profileRowHeader">
<i class="glyphicon glyphicon-folder-close" id="folderIcon"></i>
</div>
单击时.profileRowHeader
我想删除类glyphicon-folder-close
并将类添加glyphicon-folder-open
到#folderIcon
这就是我正在尝试的:
$('.profileRowHeader').click(function() {
$(this).find("#folderIcon").toggleClass('glyphicon-folder-open','glyphicon-folder-close');
});
但它所做的只是添加glyphicon-folder-open
类而不是删除glyphicon-folder-close
类,如下所示:
<i class="glyphicon glyphicon-folder-close glyphicon-folder-open" id="folderIcon"></i>
这是预期的行为吗?如果可能的话,我真的需要删除它