myOnClickTrigger alert this attr checked mycheckbox click myOnClickTri

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
myOnClickTrigger() {
alert($(this).attr('checked'));
}
$('#mycheckbox').click(myOnClickTrigger);
function mySampleFunc() {
...code...
$('#mycheckbox').trigger('click');
...code...
}
/* QUESTION
when i realy click on my checkbox. i see alert -> True and my checkbox do `checked`
when i start mySampleFunc(). i see alert -> False; and my checkbox do `checked`
*/