Skip to main content

HTML Guide

The “longdesc” attribute on the “iframe” element is obsolete. Use a regular “a” element to link to the description.

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.

Learn more:

Related W3C validator issues