HTML Guide for longdesc
The issue you’re encountering comes from using the longdesc attribute on an iframe element. The longdesc attribute was historically used to provide a URL to a long description of the content. However, it is now considered obsolete and should not be used. Instead, you should use a regular a (anchor) element to provide a link to the description.
Here’s a short guide on how to fix this issue:
Original Code with longdesc
<iframe src="video.html" longdesc="description.html" title="Video"></iframe>
Updated Code with Regular a Element
The recommended approach is to use a regular a element to provide a link to the description, like in the following example:
<iframe src="video.html" title="Video"></iframe>
<p>
<a href="description.html">Long description of the video content</a>
</p>
Explanation
- Original Code: The longdesc attribute is used on the iframe element, which is now obsolete.
- Updated Code: We remove the longdesc attribute and provide an external link using the a element to guide users to the description.
The deprecated property longdesc on img elements was used in HTML4 to specify the URL of a text or HTML file which contained a long-form description of the image. This could be used to provide optional added details beyond the short description provided in the title or alt attributes.
Here’s an example from HTML4:
<img
src="cat.jpg"
alt="Smiling Cat"
longdesc="image-descriptions/smiling-cat.html" />
This, however, is no longer valid in HTML5 and can be converted to the following instead:
<a href="image-descriptions/smiling-cat.html">
<img src="cat.jpg" alt="Smiling Cat" />
</a>