The correct attribute for providing a textual alternative to an image is alt
. Including an alt
attribute is a requirement of the HTML standard, but it's not required that the alt attribute contains content (alt=""
is acceptable if the image is purely decorative and contains no meaningful content).
title
, meanwhile, is purely optional and always has been - it can implement a simple tooltip, if that's something you'd like to do (bear in mind that it won't work on touchscreen devices, though).
See also WebAIM's guidance (emphasis in original):
Every image must have an alt
attribute. This is a requirement of HTML standard (with perhaps a few exceptions in HTML5). Images without an alt
attribute are likely inaccessible. In some cases, images may be given an empty or null alt
attribute (e.g., alt=""
).
Note that the "few exceptions" refers to a fairly unusual situation mentioned in the W3C HTML spec where figcaption
is already used to provide a caption, and where "the author is unable to provide an appropriate text alternative", and even then "Such cases are to be kept to an absolute minimum. If there is even the slightest possibility of the author having the ability to provide real alternative text, then it would not be acceptable to omit the alt
attribute."