Why not pass additional parameters, as it should be in accordance with the documentation?
The same code works correctly jQuery 1.8
<input type="checkbox" name="test" value="qqq">
$('input[value="qqq"]').on('click', function(event, data){
alert(data);
});
$('input[value="qqq"]').trigger('click', ['QQQ']);
An example of working behavior in jQuery 1.8: http://jsfiddle.net/kbr6h11z/1/
UPD1: My solution to this problem:
$('input[value="qqq"]').on('click', function(event, data){
alert(data);
if (data!= null) $(this).prop('checked', !$(this).prop('checked'));
});
$('input[value="qqq"]').triggerHandler('click', ['QQQ']);
source
share