Search code examples
jquerysizzle

How to disable click jquery when got class 'active'


I want to disable clicking when div.button ol.control li has class active. I already use .bind(), but it's not working, please, help me, thanks!

this my script http://jsfiddle.net/surya31/HcaBS/


Solution

  • You don't need to disable, you can explicitly negate it in the selector:

    $('div.button ol.control li:not(.active)').click(function(){ ...