如何在使用者點選 HTML 中的超連結時指定下載目標?
使用 download 屬性可在單擊超連結時設定要下載的檔案。將此屬性的值設定為下載檔案的檔名,例如影像。
示例
<!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://tutorialspoint.tw/java/images/if_statement.jpg" download> <img border = "0" src = "https://tutorialspoint.tw/java/images/if_statement.jpg" alt="Java" width="400" height="450"> </a> </body> </html>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP