detect mouse click

detect mouse click

Hello,

I want to detect mouse clicks on all .selectall:not(. desactivated ) elements.

I have tried the 2 different solutions here :
[code] $(document).on('click', ".selectall:not(.desactivated)", function(){ [/code]
[code] $('.selectall:not(.desactivated)').unbind('click').click(function(){ [/code]

The first solution works on some elements only : it does not apply to some elements in the page.

The second solution works on all . selectall elements, even if they have the  . desactivated class.

Could someone please help me ?