I want to write a selector that targets the first element that does not have a specific class.
<ul>
<li class="someClass">item 1</li>
<li>item 2</li> <-- I want to select this
<li class="someClass">item 3</li>
<li>item 4</li>
</ul>
I know how to select all elements that do not have "someClass":
$('li not:(.someClass)').dostuff();
But I do not know how to select only the first element that does not have "someClass".
Does anyone know how to do this?
timkl source
share