title: how to select button by particular text using jquery
body: <p>I am trying to change CSS of button using jquery, but i am not able to find the button using text property, my JQuery is:</p>
  
  <pre><code> $.ajax({
          url : "{{url('booktable')}}",
          type : "GET",
          data : {},
          success : function(data){
            $.each(data, function(index, element){
              if(element.table_aval == 0)
              {
                var elmt = element.table_no;
                $('#table button[text='+elmt+']').css('color','red');
              }
  
            });
          }
        });
  </code></pre>
  
  <p>buttons are group of button created by foreach loops, thats why I am trying to find it using text attribute, how can i do that, buttons are:</p>
  
  <pre><code>                         &lt;tbody&gt;
                          @foreach($tables as $table)
                          &lt;tr id=""&gt; 
                              &lt;!--input type="hidden" name="table_no" id="tno" value=""--&gt;
                              &lt;td style="text-align: center;"&gt;
                                &lt;button class="btn" &gt;{{$table-&gt;table_no}} &lt;/button&gt;
                              &lt;/td&gt;
                          &lt;/tr&gt;
                          @endforeach
                        &lt;/tbody&gt;
  </code></pre>