Home
HTML
HTML Images
Image maps
Tryit: HTML image map - execute a function
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h2>Image Maps</h2> <p>Click on the cup of coffee to execute a JavaScript function:</p> <img src="workplace.jpg" alt="Workplace" usemap="#workmap" width="400" height="379"> <map name="workmap"> <area shape="circle" coords="337,300,44" href="coffee.htm" onclick="myFunction()"> </map> <script> function myFunction() { alert("You clicked the coffee cup!"); } </script> </body> </html>