![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to specify that the target will be downloaded when a user clicks on the hyperlink in HTML?
Use the download attribute to set the file to download on click of the hyperlink. Set the value of the attribute to the name of the downloaded file, for example, image.
Example
<!DOCTYPE html> <html> <body> <h3>if statement in Java</h3> <p>The following is an image explaining the concept if <b>if-statmement in Java</b> (Click to download):<p> <a href = "https://www.tutorialspoint.com/java/images/if_statement.jpg" download> <img border = "0" src = "https://www.tutorialspoint.com/java/images/if_statement.jpg" alt="Java" width="400" height="450"> </a> </body> </html>
Advertisements