Wrong href syntax
-
Hello everyone,
I’m using the Cookie Notice & Compliance for GDPR/CCPA plugin and have encountered an accessibility issue related to the markup generated by the plugin.
Description of the problem:
The accessibility analyzer reports errors with the use of links for actions that do not involve navigation. Specifically, the following errors appear:- Issue ID 146: htmlCopiarEditar
<a href="#" id="cn-accept-cookie" data-cookie-set="accept" class="cn-set-cookie cn-button" aria-label="Aceptar" style="background-color: #adadad">Aceptar</a> - Issue ID 147: htmlCopiarEditar
<a href="#" id="cn-refuse-cookie" data-cookie-set="refuse" class="cn-set-cookie cn-button" aria-label="Rechazar" style="background-color: #adadad">Rechazar</a> - Issue ID 148: htmlCopiarEditar
<a href="#" class="cn-revoke-cookie cn-button" aria-label="Revocar" style="background-color: #adadad">Revocar</a>
The issue is that
<a>tags withhref="#"are being used for actions (accepting, rejecting, and revoking cookies), which is not semantically correct. According to accessibility best practices, elements that trigger actions should be buttons (<button>) instead of links, since<a>tags are meant for navigation.My question:
Is there any way to modify or override the markup generated by the plugin to resolve this issue? I haven’t found any documentation on the matter. I would like to know if there is a hook, filter, or any method to customize the HTML (for example, changing<a>to<button>) so that it complies with accessibility recommendations.Thank you in advance for any suggestions or solutions you might offer.
Regards,
Darío Gómez González - Issue ID 146: htmlCopiarEditar
The topic ‘Wrong href syntax’ is closed to new replies.