I have this code which prevents default behavior on all elements:
$('body *').click(function(e){
e.stopPropagation();
e.preventDefault();
});
Now I would like to programmatically click a certain link in the page but first I have to remove the e.preventDefault();
so I used unbind
:
$('a')[0].unbind('click');
$('a')[0].click();
This doesn't work for me. What am I doing wrong?