I think this is probably because clicking on the checkbox actually causes a
change in the state of the checkbox and then the click event is called,
whereas all you're doing is calling the click event when you use trigger.


Andreas Wahlin-4 wrote:
> 
> I bind a click event to a checkbox and check it's checked status  
> (with this.checked).
> The problem is that the checked status is different depending on  
> whether the trigger comes from an actual click on the element from  
> the user, or if I trigger it programatically with trigger. Anyone  
> solved this?
> 
> sample code
> 
> $(checkbox).bind('click', function() {
>    alert(this.checked); // different if user clicks or if I use $ 
> (checkbox).trigger('click')
> });
> 
> 
> andreas
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/difference-in-trigger-and-bind-on-checkbox-click-tf3201534.html#a8889945
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to