{"id":4990,"date":"2015-06-22T12:15:30","date_gmt":"2015-06-22T09:15:30","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=4990"},"modified":"2017-12-21T16:46:05","modified_gmt":"2017-12-21T14:46:05","slug":"jquery-remove-class-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/","title":{"rendered":"jQuery remove class example"},"content":{"rendered":"<p>Very often on a webpage we need to change the visual representation of a DOM element to display some non-text information like changing a color to red that would mean some error or warning, or probably changing parameters of an element on mouseenter event.<\/p>\n<p>All of this can be implemented using an elegant combination of css and javascript.<\/p>\n<p>But practically every time you end up with having too much style options, you group them into classes, and then you run into a large heap of classes, which is hard to maintain.<\/p>\n<p>It&#8217;s time when jQuery can help you! Because it provides a very simple API to deal with classes. Let&#8217;s look at an example.<br \/>\n[ulp id=&#8217;qGGDqWnle19VavkM&#8217;]<\/p>\n<h3>1. HTML<\/h3>\n<p>First we&#8217;ll introduce an HTML code. Here we have a <code>div<\/code> and a <code>span<\/code> which contains a bit of text. Both of them have some classes described in style.css file. On button click event we&#8217;ll perform some actions to change colors or shapes or anything else.<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n\t&lt;title&gt;JQuery remove class example&lt;\/title&gt;\r\n\t&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;\r\n\t&lt;script src=&quot;https:\/\/code.jquery.com\/jquery-2.1.3.min.js&quot;&gt;&lt;\/script&gt;\r\n\t&lt;script src=&quot;js.js&quot;&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\t&lt;div class=&quot;centered yellowed rectangled&quot;&gt;\r\n\t\t&lt;span class=&quot;bordered blocked centeredText&quot;&gt;\r\n\t\t\tI'm so stylish!\r\n\t\t&lt;\/span&gt;\r\n\t\t&lt;button onclick=&quot;changeSomething();&quot; class=&quot;bordered&quot;&gt;Change background&lt;\/button&gt;\r\n\t&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h3>2. CSS<\/h3>\n<p>In css file we&#8217;ll define already used in html custom classes:<\/p>\n<ul>\n<li><code>centered<\/code><\/li>\n<li><code>yellowed<\/code><\/li>\n<li><code>rectangled<\/code><\/li>\n<li><code>bordered<\/code><\/li>\n<li><code>blocked<\/code><\/li>\n<li><code>centeredText<\/code><\/li>\n<\/ul>\n<pre class=\"brush:css\">.rectangled {\r\n\twidth: 400px;\r\n\theight: 100px;\r\n}\r\n.centeredText {\r\n\ttext-align: center;\r\n}\r\n.centered {\r\n\tmargin: 0 auto;\r\n}\r\n.bordered {\r\n\tborder: 3px solid green;\r\n}\r\n.blocked {\r\n\tdisplay: block;\r\n}\r\n.yellowed {\r\n\tbackground: yellow;\r\n}\r\n<\/pre>\n<h3>3. Javascript<\/h3>\n<p>On button click we&#8217;ll just change the color of the div by removing <code>yellowed<\/code> class<\/p>\n<pre class=\"brush:js\">function changeSomething() {\r\n\t$(\"div\").removeClass(\"yellowed\");\r\n}\r\n<\/pre>\n<figure id=\"attachment_5019\" aria-describedby=\"caption-attachment-5019\" style=\"width: 407px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/yellow.jpg\"><img decoding=\"async\" class=\"wp-image-5019 size-full\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/yellow.jpg\" alt=\"yellow\" width=\"407\" height=\"180\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/yellow.jpg 407w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/yellow-300x133.jpg 300w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><\/a><figcaption id=\"caption-attachment-5019\" class=\"wp-caption-text\">Changing style with jQuery &#8211; Before event<\/figcaption><\/figure>\n<p>In your browser you should see something like this<\/p>\n<figure id=\"attachment_5018\" aria-describedby=\"caption-attachment-5018\" style=\"width: 407px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/white.jpg\"><img decoding=\"async\" class=\"wp-image-5018 size-full\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/white.jpg\" alt=\"white\" width=\"407\" height=\"180\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/white.jpg 407w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/white-300x133.jpg 300w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><\/a><figcaption id=\"caption-attachment-5018\" class=\"wp-caption-text\">Changing style with jQuery &#8211; After event<\/figcaption><\/figure>\n<h3>4. Modifying several elements<\/h3>\n<p>You should notice that these class modifications may influence not only one element, but everything you select. For example we could add one more <code>div<\/code> to the body<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;div class=&quot;centered rectangled greened&quot;&gt;\r\n        This is the second div\r\n&lt;\/div&gt;\r\n<\/pre>\n<p>And of course implement a new style class<\/p>\n<pre class=\"brush:css\">.greened {\r\n\tbackground: green;\r\n}\r\n<\/pre>\n<p>The Javascript function <code>changeSomething()<\/code> will now contain another piece of code<\/p>\n<pre class=\"brush:js\">$(\".centered\").removeClass(\"centered\");\r\n<\/pre>\n<p>After implementing these changes and reloading the page you will see that both divs move to the left side of the window after button click.<\/p>\n<h3>5. Toggling<\/h3>\n<p>In some cases we don&#8217;t need to add or remove different style classes but just one single class. JQuery allows us to use <code>toggleClass<\/code> method. It&#8217;s pretty useful because you don&#8217;t have to care if the class is present or not. Let&#8217;s create a little checkbox. In HTML we&#8217;ll need two nested divs<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n\t&lt;title&gt;JQuery remove class example&lt;\/title&gt;\r\n\t&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;\/&gt;\r\n\t&lt;script src=&quot;https:\/\/code.jquery.com\/jquery-2.1.3.min.js&quot;&gt;&lt;\/script&gt;\r\n\t&lt;script src=&quot;js.js&quot;&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\t&lt;div id=&quot;toggle&quot; class=&quot;centered rectangled bordered&quot;&gt;\r\n\t\t&lt;div id=&quot;inner&quot; class=&quot;rectangled yellowed&quot;&gt;&lt;\/div&gt;\r\n\t&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>The stylesheet code can be reduced a little<\/p>\n<pre class=\"brush:css\">.rectangled {\r\n\twidth: 10px;\r\n\theight: 10px;\r\n}\r\n.centered {\r\n\tmargin: 0 auto;\r\n}\r\n.bordered {\r\n\tborder: 3px solid green;\r\n}\r\n.yellowed {\r\n\tbackground: yellow;\r\n}\r\n<\/pre>\n<p>And in javascript code we&#8217;ll add <code>$(document).ready<\/code> just to be sure the DOM is ready and we can place <code>script<\/code> tag wherever we want<\/p>\n<pre class=\"brush:js\">$(document).ready(function() { \/\/ waits until DOM is ready\r\n\t$(\"#toggle\").click(function() { \/\/ selects outer div\r\n\t\t$(\"#inner\").toggleClass(\"yellowed\"); \/\/ toggles class of inner div\r\n\t});\r\n});\r\n<\/pre>\n<h3>6. Removing multiple classes<\/h3>\n<p><code>removeClass<\/code> method allows you to remove several classes at the same time. It can be implemented using different approaches.<\/p>\n<p>You may just provide a list of classes passing them as parameters. Consider the following javascript code in the previous example (it will only &#8220;uncheck&#8221; the checkbox)<\/p>\n<pre class=\"brush:js\">$(document).ready(function() { \r\n\t$(\"#toggle\").click(function() {\r\n\t\t$(\"#inner\").removeClass(\"yellowed\", \"rectangled\");\r\n\t});\r\n});\r\n<\/pre>\n<p>Or you may pass a single string parameter which contains a list of classes to remove separated with a space<\/p>\n<pre class=\"brush:js\">$(document).ready(function() { \r\n\t$(\"#toggle\").click(function() {\r\n\t\t$(\"#inner\").removeClass(\"yellowed\", \"rectangled\");\r\n\t});\r\n});\r\n<\/pre>\n<p>Or you may even provide a function that returns such list if you need to prepare it dynamically (since jQuery 1.4)<\/p>\n<pre class=\"brush:js\">$(document).ready(function() {\r\n\t$(\"#toggle\").click(function() {\r\n\t\t$(\"#inner\").removeClass(getClasses);\r\n\t});\r\n});\r\n\r\nfunction getClasses() {\r\n\treturn \"yellowed rectangled\";\r\n}\r\n<\/pre>\n<h3>7. Removing or replacing all classes<\/h3>\n<p>Sometimes you&#8217;ll probably need to remove or replace all the classes of an element. For this case jQuery provides a very convenient way. Let&#8217;s continue with the same HTML and CSS and add one more class<\/p>\n<pre class=\"brush:css\">.reded {\r\n        background: red;\r\n}\r\n<\/pre>\n<p>Depending on your needs you can use one of these approaches<\/p>\n<pre class=\"brush:js\">$(document).ready(function() {\r\n\t\t$(\"#toggle\").click(function() {\r\n\t\t\t$(\"#inner\").removeClass(); \/\/ removes all the classes\r\n\t\t});\r\n\t});\r\n<\/pre>\n<pre class=\"brush:js\">$(document).ready(function() {\r\n\t\t$(\"#toggle\").click(function() {\r\n\t\t\t$(\"#inner\").removeClass().addClass(\"rectangled reded\"); \/\/ removes all the classes and adds the given ones\r\n\t\t});\r\n\t});\r\n<\/pre>\n<pre class=\"brush:js\">\t$(document).ready(function() {\r\n\t\t$(\"#toggle\").click(function() {\r\n\t\t\t$(\"#inner\").attr(\"class\", \"rectangled reded\"); \/\/ replaces all the classes with the given ones\r\n\t\t});\r\n\t});\r\n<\/pre>\n<h3>8. Download<\/h3>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/05\/JQuery_remove_class_example1.zip\"><strong>JQueryRemoveClass<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Very often on a webpage we need to change the visual representation of a DOM element to display some non-text information like changing a color to red that would mean some error or warning, or probably changing parameters of an element on mouseenter event. All of this can be implemented using an elegant combination of &hellip;<\/p>\n","protected":false},"author":74,"featured_media":919,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-4990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>jQuery remove class example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Very often on a webpage we need to change the visual representation of a DOM element to display some non-text information like changing a color to red\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"jQuery remove class example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Very often on a webpage we need to change the visual representation of a DOM element to display some non-text information like changing a color to red\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/dimbasick\" \/>\n<meta property=\"article:published_time\" content=\"2015-06-22T09:15:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-21T14:46:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Dmitry Mishchenko\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dimbasick\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dmitry Mishchenko\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/\"},\"author\":{\"name\":\"Dmitry Mishchenko\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/590734bdf375bf270d42b06f878f6e57\"},\"headline\":\"jQuery remove class example\",\"datePublished\":\"2015-06-22T09:15:30+00:00\",\"dateModified\":\"2017-12-21T14:46:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/\"},\"wordCount\":796,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg\",\"articleSection\":[\"jQuery\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/\",\"name\":\"jQuery remove class example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg\",\"datePublished\":\"2015-06-22T09:15:30+00:00\",\"dateModified\":\"2017-12-21T14:46:05+00:00\",\"description\":\"Very often on a webpage we need to change the visual representation of a DOM element to display some non-text information like changing a color to red\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"jQuery\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/jquery\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"jQuery remove class example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/590734bdf375bf270d42b06f878f6e57\",\"name\":\"Dmitry Mishchenko\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/52a7208c47939e10b039bf165c7a545b198cc1d6b716ab0eea58add16782782c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/52a7208c47939e10b039bf165c7a545b198cc1d6b716ab0eea58add16782782c?s=96&d=mm&r=g\",\"caption\":\"Dmitry Mishchenko\"},\"description\":\"This year I graduate from Applied Mathematics department of Brest State University. I'm fond of genetic algorithms and my degree work will be about generating timetables. Also I'm keen on programming and web-development, especially Java and Javascript. Now I work as a Java Developer at Java department of VRP Consulting.\",\"sameAs\":[\"https:\/\/www.facebook.com\/dimbasick\",\"https:\/\/www.linkedin.com\/profile\/view?id=296022174\",\"https:\/\/x.com\/dimbasick\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/dmitry-mishchenko\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"jQuery remove class example - Web Code Geeks - 2026","description":"Very often on a webpage we need to change the visual representation of a DOM element to display some non-text information like changing a color to red","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/","og_locale":"en_US","og_type":"article","og_title":"jQuery remove class example - Web Code Geeks - 2026","og_description":"Very often on a webpage we need to change the visual representation of a DOM element to display some non-text information like changing a color to red","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/dimbasick","article_published_time":"2015-06-22T09:15:30+00:00","article_modified_time":"2017-12-21T14:46:05+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg","type":"image\/jpeg"}],"author":"Dmitry Mishchenko","twitter_card":"summary_large_image","twitter_creator":"@dimbasick","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Dmitry Mishchenko","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/"},"author":{"name":"Dmitry Mishchenko","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/590734bdf375bf270d42b06f878f6e57"},"headline":"jQuery remove class example","datePublished":"2015-06-22T09:15:30+00:00","dateModified":"2017-12-21T14:46:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/"},"wordCount":796,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg","articleSection":["jQuery"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/","name":"jQuery remove class example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg","datePublished":"2015-06-22T09:15:30+00:00","dateModified":"2017-12-21T14:46:05+00:00","description":"Very often on a webpage we need to change the visual representation of a DOM element to display some non-text information like changing a color to red","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/jquery-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/jquery\/jquery-remove-class-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"jQuery","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/jquery\/"},{"@type":"ListItem","position":4,"name":"jQuery remove class example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/590734bdf375bf270d42b06f878f6e57","name":"Dmitry Mishchenko","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/52a7208c47939e10b039bf165c7a545b198cc1d6b716ab0eea58add16782782c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/52a7208c47939e10b039bf165c7a545b198cc1d6b716ab0eea58add16782782c?s=96&d=mm&r=g","caption":"Dmitry Mishchenko"},"description":"This year I graduate from Applied Mathematics department of Brest State University. I'm fond of genetic algorithms and my degree work will be about generating timetables. Also I'm keen on programming and web-development, especially Java and Javascript. Now I work as a Java Developer at Java department of VRP Consulting.","sameAs":["https:\/\/www.facebook.com\/dimbasick","https:\/\/www.linkedin.com\/profile\/view?id=296022174","https:\/\/x.com\/dimbasick"],"url":"https:\/\/www.webcodegeeks.com\/author\/dmitry-mishchenko\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/4990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/74"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=4990"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/4990\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/919"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=4990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=4990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=4990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}