Remove HTML attribute from clickable image

2
Hello forum,   I have a picture (logo) on top of a page. The logo has an “on click” event and therefore the html attribute “role=button” is applied. I want to get rid of the “role=button” attribute. Does anybody knows a way of getting rid of the attribute whithout loosing the “on click” action of the logo picture?    kind regards,   Jasper 
asked
3 answers
0

Because we want to change it to a link instead of a button. Because of the clickable nature of the picture plus event it gets the role=”button” automatically.

answered
0

Maybe I misunderstand the requirement, but if you want to open a link from an image you can change the on click event:

instead of clicking the image itself, you could also apply the on click event to the div that could be wrapping your image

answered
0

That doens’t change the role to “link”. I am trying to do so because of the accessability. 

answered