title: Getting label name in jQuery when it gets clicked
body: <p>I have a link to label in which text is <code>questions.label</code>: </p>
  
  <pre><code> &lt;%= link_to questions.label, '#', class: "set-label" ,style:"margin-right:5px; float: right;" %&gt;&lt;br&gt;
  </code></pre>
  
  <p>how to get that <code>questions.label</code> value in my jQuery?</p>
  
  <pre><code> $(".set-label").on("click", function (e) {
   lab = $(this).text       // get the label that was clicked, but this doesnt get the text
   $(".labels").hide()      
   $(".labels."+lab).show() 
   });
  </code></pre>
  
  <p>this is the part I want to display when the label is clicked:</p>
  
  <pre><code>&lt;div class="labels&lt;%= question.label %&gt;"&gt;
  &lt;h2&gt; &lt;%= question.text %&gt;&lt;/h2&gt;
  &lt;form role="form" action=""&gt;
  &lt;div class="answer"&gt;
  &lt;input type ='text' name=""&gt; &lt;/input&gt;
  &lt;/div&gt;
  &lt;%= link_to "Delete", {controller: "questionnaires", action: "destroy", id: question.id %&gt;
  &lt;% end %&gt;
  &lt;a class="btn btn-rounded btn-primary" style="float: none;margin-left: 3px;"  data-toggle="modal" data-target="#addQuestion" id = "ansButton"  &gt; Add Question &lt;/a&gt;
  &lt;% end %&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>image for div class for separated labels:</p>
  
  <p><img src="https://i.stack.imgur.com/gKoDe.png" alt=""></p>
  
  <p>image for wardrobe label:</p>
  
  <p><img src="https://i.stack.imgur.com/sbsAI.png" alt=""></p>
  
  <p>image for personal style:</p>
  
  <p><img src="https://i.stack.imgur.com/wAk3r.png" alt=""></p>