Search code examples
javascriptjqueryinternet-explorer-7triggers

jQuery trigger not working in IE. Why?


$('#XynBp0').find('input').each(function(){
    if ($(this).attr('value') == 'Cancel'){
        $(this).trigger('click');
    }
});

doesn't work in IE7


Solution

  • it's strange but try to create a custom event

    $('#XynBp0 input').bind('custom',function(){
     //code
    })
    
    
    $('#XynBp0').find('input').each(function(){
        if ($(this).attr('value') == 'Cancel'){
            $(this).trigger('custom');
        }
    });
    

    Does this work?