แอตทริบิวท์ download ของ <area> ใน HTML
แอตทริบิวท์ download ขององค์ประกอบ <area> ใช้สำหรับกำหนดชื่อไฟล์ที่จะถูกดาวน์โหลดเมื่อผู้ใช้คลิกที่ไฮเปอร์ลิงก์
รูปแบบการใช้งานมีดังนี้:
<area download="file">
file คือชื่อไฟล์ที่ตั้งสำหรับการดาวน์โหลด
ตัวอย่าง
<!DOCTYPE html>
<html>
<body>
<h2>การเรียนรู้</h2>
<p>เรียนรู้เทคโนโลยีเหล่านี้ได้อย่างง่ายดาย....</p>
<img src="/images/usemap.gif" alt="usemap" border="0" usemap="#tutorials"/>
<map name="tutorials">
<area shape="poly" coords="74,0,113,29,98,72,52,72,38,27" href="/perl/index.htm" alt="Perl Tutorial" download="perl" />
<area shape="rect" coords="22,83,126,125" alt="HTML Tutorial" href="/html/index.htm" target="_blank" download="html" />
<area shape="circle" coords="73,168,32" alt="PHP Tutorial" href="/php/index.htm" target="_blank" download="php" />
</map>
</body>
</html>
ผลลัพธ์

ตอนนี้ เมื่อคุณคลิกที่ "PERL" ไฟล์จะถูกดาวน์โหลด:

ข้างต้น เราได้เปิดใช้งานตัวเลือกดาวน์โหลดโดยใช้แอตทริบิวท์ download ของ <area>:
<area shape="poly" coords="74,0,113,29,98,72,52,72,38,27" href="/perl/index.htm" alt="Perl Tutorial" download="perl" />
แอตทริบิวท์ download ถูกตั้งค่าด้วยชื่อ "perl" ซึ่งจะเป็นชื่อไฟล์:
download="perl"