code:
<a href="javascript:void(0)" role="button" title="Start a Process link" style="">Start a Process link</a>
I am using wave tool for Web accessibility. Wave tool gives error:
Redundant link- Adjacent links go to the same URL.
Ref : WCAG 2.4.4 Link Purpose (In Context) (Level A)
I understand due to href="javascript:void(0)"
it gives the error "Adjacent links go to the same URL."
But I have to run jQuery function (to check validation & set value before redirect) on click of the <a>
tag.
Any suggestion please?
The error points out that there is another link element (anchor <a>
with a valid href
attribute or another element with role="link"
) that has the same target. In your case it is very likely as the target (href
) is javascript:void(0)
and there's probably more than one link like that. So the Wave thinks that those links are the same thus flagging WCAG 2.0 Success Criterion 2.4.4 Link Purpose (In Context).
<button>
(as was mentioned in the comment above) - it will handle all events naturallyhref="#"
)role="button"
- it will overwrite all link behavior otherwise.title
and inner text is excessive - the role will be communicated to screen reader users from the markup, no need to add it in labels.<a href="#" title="Start a Process" style="">Start a Process</a>
Or
<button style="">Start a Process</button>