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
Release: 2016-05-16 16:38:50
Original
1814 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template