I need help with the below jQuery, it's not working for me. I want to fire some actions only if <optgroup label="Knowledge Base">
does not exist
My HTML (which can't be changed):
<select id="entry_forum_id" name="entry[forum_id]">
<optgroup label="Knowledge Base"> … </optgroup>
<optgroup label="Incidents"> … </optgroup>
<optgroup label="Articles"> … </optgroup>
</select>
My jQuery attempt:
if($('optgroup:not([label="Knowledge Base"])')) {
alert('test');
}