SyntaxFix
Write A Post
Hire A Developer
Questions
You can use the Logical NOT ! operator:
!
if (!$(this).parent().next().is('ul')){
Or equivalently (see comments below):
if (! ($(this).parent().next().is('ul'))){
For more information, see the Logical Operators section of the MDN docs.