I have used the download attribute of a link to download a file. However, when I trigger the click event from another method, it doesn't download the file. Why is that so? I have checked that the click event is being triggered. Here's my test on jsfiddle - http://jsfiddle.net/6Fkb5/1/
<a href="#" download="https://www.dropbox.com/s/shd31hvnsn0fd0v/Getting%20Started.pdf" id="testdownload">Test Download</a>
var count=0;
$('#testdownload').on('click', function(){
count++;
$('#log').append('<li>Click triggered ' + count + ' times</li>');
});
$('#testdownload').trigger('click');