download files using vanilla javascript code example
Example: javascript download file
$('a#someID').attr({target: '_blank',
href : 'http://localhost/directory/file.pdf'});
$('a#someID').attr({target: '_blank',
href : 'http://localhost/directory/file.pdf'});