I need help with jQuery below, this does not work for me. I want to perform some actions only if <optgroup label="Knowledge Base"> does not exist
My HTML (which cannot 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'); }
source share