

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 search the alternate text of an image-map area in JavaScript?
To search the alternate (alt) text of an image-map area in JavaScript, use the alt property. You can try to run the following code to get the alternate text.
Example
<!DOCTYPE html> <html> <body> <img src = "/images/html.gif" alt = "HTML Map" border = "0" usemap = "#html"/> <map name = "html"> <area id = "myarea" shape = "circle" coords = "154,150,59" href = "about.htm?id=company" alt = "Team" target = "_self" > </map> <script> var x = document.getElementById("myarea").alt; document.write("<br>Alternate Text: "+x); </script> </body> </html>
- Related Questions & Answers
- Set the coordinates of the area in an image map in HTML?
- How to create an image map in JavaScript?
- How do we define an area in an image map with HTML?
- How to search the querystring part of the href attribute of an area in JavaScript?
- How to set the positioning area of the background image with JavaScript?
- How to search and display the pathname part of the href attribute of an area with JavaScript?
- How to find the area of an image contour Java OpenCV library?
- How to specify an image as a client-side image-map in HTML?
- How to use JavaScript to create client-side image map?
- How do we create an image map in HTML?
- How to include an alternate text when the original element fails to display in HTML?
- Set an image as a server-side image map in HTML?
- Adding default search text to search box in HTML with JavaScript?
- How to get the hash part of the href attribute of an area in JavaScript?
- Alternate addition multiplication in an array - JavaScript
Advertisements