How to specify that the target will be downloaded when a user clicks on the hyperlink in HTML?

HTMLWeb DevelopmentFront End Technology

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.


<!DOCTYPE html>
      <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 = "" download>
         <img border = "0" src = "" alt="Java" width="400" height="450">
Updated on 03-Mar-2020 05:32:06