For example if I want to do something if parent element for used element hasn\'t got ul
tag as next element, how can I achieve this?
I t
Try negation operator !
before $(this)
:
if (!$(this).parent().next().is('ul')){
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.