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.
More Related Contents:
- How do I test if a variable does not equal either of two values?
- jQuery – how to check if an element exists?
- my JavaScript using jQuery is not working [closed]
- PHP get contents of a div, and echo the div contents in same page
- how to call javascript/jQuery when javascript is disabled in mozilla/ie? [closed]
- how to store new elements added in webpage by user? [closed]
- Why does my program not work
- Javascript: function doesnt work even though condition is met (hard for me to explain)
- Get the size of the screen, current web page and browser window
- Set cursor position on contentEditable
- What’s the easiest way to call a function every 5 seconds in jQuery? [duplicate]
- How to append in JavaScript? [duplicate]
- How to dynamically insert a tag via jQuery after page load?
- Remove items from array with splice in for loop [duplicate]
- jQuery: live() vs delegate()
- Accessing a CSS custom property (aka CSS variable) through JavaScript
- How to call ajax in WordPress
- jQuery keypress() event not firing?
- JQuery or JavaScript: How determine if shift key being pressed while clicking anchor tag hyperlink?
- Sort a string date array
- jQuery: keyup event for mobile device
- Ajax HEAD request via Javascript/jQuery
- How to split a string at the first `/` (slash) and surround part of it in a “?
- What does the “$” sign mean in jQuery or JavaScript? [duplicate]
- How to execute javascript inside a script tag returned by an ajax response
- Using JQuery to bind “focus” and “blur” functions for “window”, doesn’t work in IE
- Convert dropdown to selection boxes with color and trigger drop down action
- Allow text box only for letters using jQuery?
- Focus tab or window
- Execute function queue in javascript