Home >Web Front-end >HTML Tutorial >Use href in html to pop up a file download dialog box when clicking a link_HTML/Xhtml_Web page production

Use href in html to pop up a file download dialog box when clicking a link_HTML/Xhtml_Web page production

WBOY
WBOYOriginal
2016-05-16 16:38:501805browse

I learned another trick today. I didn’t know it before, but I have done too few things...

Goal: To achieve a pop-up file download dialog box when clicking a link
Code:

Copy code
The code is as follows:


Code downloadCode download

download



If the browser supports the format that can be opened, it will open it directly online by default (such as word or picture). If the format is not supported, it will pop up a download prompt. It is best to make it into a .rar format file
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn