Home > Article > Web Front-end > Detailed introduction and usage examples of HTML5 download attribute_html5 tutorial skills
However, there are a lot of small, very nice features; one of them is the newly added download attribute. The download attribute allows us to specify that the browser uses a new file name when downloading, that is, renaming the downloaded file on the client side. Instead of the original file name on the link. In fact, a more appropriate name for the download attribute is downloadName.
HTML code
Put the download attribute on the A link…
When the user clicks this link, the new name in the download attribute value will be displayed in the pop-up download box. The name of the file you save is "Budget Sheet.pdf". Moreover, the download attribute can force the download operation to be triggered, much like the operation we perform on the server side in PHP.
The download attribute is very useful when you need to perform a download task. Many times, the file names we store on the server are represented by serial numbers to ensure their uniqueness, but such names are meaningless to users. The client-side renaming function of the download attribute allows us to easily change the download file name.