What is the longdesc attribute? Can you explain its purpose?

Answer Posted / chaitu

The longdesc attribute of the img element has been around since HTML 4 and is also valid in HTML5. This attribute is designed to provide a more detailed description of an image, compared to the information offered in the alt attribute. The interesting thing is that instead of providing a description by itself (like the alt attribute does), longdesc points to a hyperlink containing the description.

An example of the use of longdesc is presented below:

<img src="italy.jpg"

alt="This image represents the map of Italy" longdesc="italy.html#description">

<!-- other content here ... -->

<section id="description">

<h2>Italy</h2>

<p>The shown map of Italy illustrates its division

in regions...</p>

</section>

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category