<div class="col-sm-6">
  <h3>First Option - <code>.is(selector)</code></h3>
  <p>In the HTML all the li's have the same text - "item". The JS changes the active li's text.
  <ul id="first_form">
    <li>item</li>
    <li class="active">item</li>
    <li>item</li>
    <li>item</li>
    <li>item</li>
    <li>item</li>
  </ul>
</div>
<div class="col-sm-6">
  <h3>Second Option - <code>.is(function())</code></h3>
  <p>Click the li's. when you click a li with the text "alert" - an alert pops.
  <ul id="second_form">
    <li>alert</li>
    <li>item</li>
    <li>item</li>
    <li>item</li>
    <li>alert</li>
    <li>item</li>
  </ul>
</div>

.active{
  color: red;
}
jQuery('#first_form li').each(function(){
  if(jQuery(this).is('.active'))
    jQuery(this).text('active item!!!');
});

jQuery('#second_form li').click(function(){
  if(jQuery(this).is(function(){
    return jQuery(this).text() == 'alert';
  }))
    alert('You clicked me!');
});

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js