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

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -