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 -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -