In a webpage,there was no tooltip present for Facebook/Twitter icons.When I inspected the code for the webpage, I saw :the title attribute value was missing as highlighted in the code below.
<a onclick="ga('send', 'social', 'Facebook',
'send''https://www.Website');"
href="https://www.Website" **title** target="_blank" ><img
src="http://www.Website/themes/act/images/facebook-mouseover.jpg"
alt="Facebook" ></a>
Please suggest the accessibility issue that might occur if "title" has no value in the HTML code.
There is no accessibility issue for a missing
title
attribute in this context (on an<a href>
). Do not use it here.https://www.paciellogroup.com/blog/2013/01/using-the-html-title-attribute-updated/
Although the image has an
alt
attribute, this code has an explicit emptytitle
tag which can lead to undetermined behavior from screenreaders.You have two solutions:
title
attribute from thea
tag.title
attribute to show an information that may be facultatively seen by people using screenreaders (as thetitle
attribute does not have a good screenreader support)If you want to explicitely target people using a screen reader use, the
aria-label
attribute on thea
element. For instance: