Forcing a Hyperlink to Download a File in HTML
Modern browsers are smart. When a hyperlink points to a plain text file, a PDF, or a CSS file, the browser previews it instead of downloading it. But sometimes we want users to download the file directly instead of viewing it in the browser. For example, when I previously went to the jQuery official site to download jquery.js, it opened as a preview, and I had to right-click and choose “Save As.” But my goal was clear: I wanted to download the file, not view it! ...