Image longDescProperty
Image Object
Definition and Usage
The longDesc property sets or returns the value of the longDesc attribute of an image.
The longdesc attribute specifies the URL of a document that contains a description of the image.
Syntax
imageObject.longDesc=URL
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the longDesc attribute.
Example
Example
Return the value of the longDesc attribute of the image:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example(example.com)</title>
</head>
<body>
<img id="compman" src="compman.gif.html" longdesc="description.htm" alt="Computerman" width="107" height="98">
<br>
<p>The value of the longdesc attribute is:
<script>
var x=document.getElementById("compman");
document.write(document.getElementById("compman").longDesc);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Example(example.com)</title>
</head>
<body>
<img id="compman" src="compman.gif.html" longdesc="description.htm" alt="Computerman" width="107" height="98">
<br>
<p>The value of the longdesc attribute is:
<script>
var x=document.getElementById("compman");
document.write(document.getElementById("compman").longDesc);
</script>
</p>
</body>
</html>
Try it Yourself »
Image Object Other Extensions