title: How to get a specify class name from multiple class in a div by using jquery?
body: <p>Is it possible to get a class as a string from multiple class in an html element.I have many classes which stored in an html element but I want to get only class name from them.</p>
  
  <p>Here is my <strong>html:</strong></p>
  
  <pre><code>&lt;div class="class1 class2 class3 class4"&gt;&lt;/div&gt;
  &lt;div class="class1 classb classv classd"&gt;&lt;/div&gt;
  &lt;div class="class1 classw classdf classl"&gt;&lt;/div&gt;
  &lt;div class="class1 classl classo classj"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>jquery:</strong></p>
  
  <pre><code>&lt;script&gt;
       $(document).ready({
  
               if($(".class1").hasClass("classw")){ 
                   var cl = $(".classw").attr('class');
                   console.log(cl)// out put: class1 classw
               }
        });
  &lt;/script&gt;
  </code></pre>
  
  <p>As above code I will get <strong>class1 classw</strong> class But i want to get only <strong>classw</strong>  class of them.</p>
  
  <p>Please help</p>