HTML DOM Image name attribute
Definition and Usage
name property sets or returns the name of the image.
grammar
imageObject.name=name
Browser Support
All major browsers support attribute name
Examples
Examples
Returns the name of the picture:
<html>
<body>
<img id="compman" name="compman"
src="compman.gif" alt="Computerman" width="107" height="98">
<br>
<script>
document.write("Image name: ");
document.write(document.getElementById('compman').name);
</script>
</body>
</html>
<body>
<img id="compman" name="compman"
src="compman.gif" alt="Computerman" width="107" height="98">
<br>
<script>
document.write("Image name: ");
document.write(document.getElementById('compman').name);
</script>
</body>
</html>
try it"
Image Object