Image.name
JavaScript 1.1+, JScript 1.0+ Nav3+, IE 3+, Opera3+ Syntax
image.name
Description
The name property of the Image object specifies the name of the image. This property can only be set by the NAME attribute of the <img> tag.
Example
Listing 7.308 displays the name of the image.
Listing 7.308 Example the of name Property
<html> <head> <title>Example of name property</title> </head> <img name="circle" src="circle.gif"> <br> <script language="JavaScript"> <!-- Hide //Display name of image document.write("The name of the image is <i>"); document.write(document.circle.name,"</i>"); //Hide End ---> </script> </html> |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.