I'm having a hard time trying to understand why this is not working as expected.
I simply am trying to target the body
element, but only if does not contain the .logged-in
class, but with the code below I get a log to the console whether the class exists or not.
if ($('body:not(.logged-in)')) {
console.log('Hi!');
}
...or...
if ($('body').not('.logged-in')) {
console.log('Hi!');
}
Am I missing something here?