SyntaxFix
Write A Post
Hire A Developer
Questions
Ternary operator works because the first part of it returns a Boolean value. In your case, jQuery's css method returns the jQuery object, thus not valid for ternary operation.