# \[jQuery 属性CSS类\] removeClass(class)

**URL:** <https://www.isharkfly.com/t/jquery-css-removeclass-class/9055>\
**Category:** 前端\
**Created:** [March 21, 2013, 3:17am UTC](https://www.isharkfly.com/t/jquery-css-removeclass-class/9055 "2013-03-21T03:17:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [March 21, 2013, 3:17am UTC](https://www.isharkfly.com/t/jquery-css-removeclass-class/9055/1 "2013-03-21T03:17:14Z")

</div>

从所有匹配的元素中删除全部或者指定的类。

返回值  
jQuery

参数  
class (String) : (可选) 一个或多个要删除的CSS类名，请用空格分开

示例  
从匹配的元素中删除 ‘selected’ 类

HTML 代码:`<p class="selected first">Hello</p> `jQuery 代码:`$("p").removeClass("selected"); `结果:`[<p>Hello</p>] `删除匹配元素的所有类

HTML 代码:`<p class="selected first">Hello</p> `jQuery 代码:`$("p").removeClass(); `结果:`[<p>Hello</p>] `
