Jquery if else in how use? -



Jquery if else in how use? -

why script not work?

$(document).ready(function() { if ($('[style *= "block"]')) { $('#bss').addclass('click') } else { $('#bss').removeclass('click') });

like mentioned in comments have syntax errors , should utilize length cause else "if" query selector object of jquery never false.

$(document).ready(function() { if ($('[style *= "block"]').length > 0) { $('#bss').addclass('click'); } else { $('#bss').removeclass('click'); } });

jquery

Comments

Popular posts from this blog

php - How to pass multiple values from url -

php - Laravel not returning controller -

c# - Confused on how to specify a Platform and Version while using ChromeOptions for RemoteWebDriver with Selenium donNet since recent updates -