jQuery using :contains() to search values of option:selected
<p>I'm trying to check whether $('select option:selected').val(); contains certain words and if so, redirect to a certain page.</p>

<p>Here's my HTML:</p>

<pre><code>&lt;select name="people_view" id="people_view"&gt;
    &lt;optgroup label="People Categories"&gt;
        &lt;option value="category_1"&gt;Members&lt;/option&gt;
        &lt;option value="category_2"&gt;Connections&lt;/option&gt;     
    &lt;/optgroup&gt;
    &lt;optgroup label="Groups"&gt;
        &lt;option value="group_1"&gt;Group 1&lt;/option&gt;
        &lt;option value="group_2"&gt;Group 2&lt;/option&gt;
        &lt;option value="group_3"&gt;Group 3&lt;/option&gt;
    &lt;/optgroup&gt;
    &lt;optgroup label="Custom Views"&gt;
        &lt;option value="view_1"&gt;Test People View&lt;/option&gt;
    &lt;/optgroup&gt;
&lt;/select&gt;
</code></pre>

<p>Here's my JS:</p>

<pre><code>    if ($('#people_view option:selected:contains("category_")')) {

        categoy_id = $(this).val().replace('category_', '');
        window.location.href = admin_url + 'people/?category=' + categoy_id;

    } else if ($('#people_view option:selected:contains("group_")')) {

        group_id = $(this).val().replace('group_', '');
        window.location.href = admin_url + 'people/?group=' + group_id;

    } else if ($('#people_view option:selected:contains("view_")')) {

        view_id = $(this).val().replace('view_', '');
        window.location.href = admin_url + 'people/?view=' + view_id;

    }
</code></pre>

<p>Is it not possible to use two selectors at once (e.g: :selected:contains()). Or am I just doing something wrong?</p>

<p>Thanks for your help!</p>
