title: how do I write a jQuery/javascript if statement so that it's triggered when a html <option> with a specific class is selected?
body: <pre><code>&lt;select&gt;
    &lt;option value='34'&gt;Trees&lt;/option&gt;
    &lt;option value='13' class='create_sub_category'&gt;Add new sub-category&lt;/option&gt;
    &lt;option value='24' class='create_sub_category'&gt;Add new sub-category&lt;/option&gt;
    &lt;option value='57'&gt;Cats&lt;/option&gt;
    &lt;option value='34' class='create_sub_category'&gt;Add new sub-category&lt;/option&gt;
  &lt;/select&gt;
  
  
  
  &lt;script type='text/javascript'&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;&lt;/script&gt;
  if (selected(".create_sub_category")) {
    alert('hi');
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Obviously, there's no such javascript or jQuery function called 'selected' that I used above in my if statement, but could someone help me find something that would do what I'm describing?</p>