title: Change Class with jquery
body: <p>Hi i use a css framework from w3school.com so i need to change some class to get better view evry time the user change the window width, and for that i use jquery but doesn't work, can get help pleas and thank you
  her is the code source.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css"&gt;
    &lt;script http://googleads.g.doubleclick.net/pcs/click?xai=AKAOjsskoPaKjpYu8DK0oiP7OYYa9-A9I7CpjKFG67eM5bDqwk7ZV2TT-34qu4fCp92Y2TEIfbX8dj-6vPUezLZ60FPo9y2zGtNrl64NtBc_79RxtrJhBn26YWvvq1XiSZtWXfY-ML7nBmtrCTm02RWO8eiXGK-gctEOfZvzaFRQISYn4GlDgpkqNyEMUm6X6-eKP7xTMr4vzjmPShzKYVE_xNd-siI_3Pk_-2U6c3x5HZpHZGOg6Fo&amp;sig=Cg0ArKJSzAR_3zib5yc4&amp;adurl=http://www.w3schools.com/w3css/w3css_templates.asp&amp;nm=2&amp;nx=179&amp;ny=48&amp;mb=1src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
   var w = window.innerWidth;
   function resize(){
   if (w &gt; 1366){
     $(".object").addClass("w3-quarter").removeClass("w3-half w3-third");
   } if else (w &lt;= 1366 &amp;&amp; w &gt; 800){
     $(".object").addClass("w3-third").removeClass("w3-half w3-qurter");
   } else { $(".object").addClass("w3-half").removeClass("w3-third w3-qurter");
   }
   }
   $(document).ready(function(){
   resize();
   $(window).resize(resize);
   });
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
   &lt;h1&gt;Heading 1&lt;/h1&gt;
   &lt;h2&gt;Heading 2&lt;/h2&gt;
  
   &lt;div class="object w3-qurter"&gt;
      &lt;p&gt;This is a paragraph.&lt;/p&gt;
      &lt;p&gt;This is another paragraph.&lt;/p&gt;
   &lt;/div&gt;
   &lt;div class="object w3-qurter"&gt;
      &lt;p&gt;This is a paragraph.&lt;/p&gt;
      &lt;p&gt;This is another paragraph.&lt;/p&gt;
    &lt;/div&gt;
   &lt;div class="object w3-qurter"&gt;
     &lt;p&gt;This is a paragraph.&lt;/p&gt;
     &lt;p&gt;This is another paragraph.&lt;/p&gt;
   &lt;/div&gt;
   &lt;div class="object w3-qurter"&gt;
     &lt;p&gt;This is a paragraph.&lt;/p&gt;
     &lt;p&gt;This is another paragraph.&lt;/p&gt;
   &lt;/div&gt;
  
  
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>