Download PDF by using jQuery/Javascript
<p>I'm trying to automatically download PDF, not open in a new window or the same window. I am running an AJAX and in ajax response I'm passing a PDF URL which must be downloaded. I want to download the file by using jQuery.</p>

<p>I want the functionality like <code>&lt;a href="url" download&gt;&lt;/a&gt;</code> </p>

<p>This link works but must work by jQuery and not appending anchor tag. If possible rather create an anchor and trigger that. How can I do that?
Any suggestion can be useful.</p>