If you just have a div/button, when they right click and "open in new tab", well they won't be able to do that.
We need to switch all our div/buttons, anything that navigates, to use a with href. And then we can add the onClick anyway and do preventDefault to prevent the link from opening in a new URL. This way, the link doesn't trigger from the click, but at the same time it's following html spec and the browser gives you the "open in new tab" buttons and it's better for the visually impaired.
If you just have a div/button, when they right click and "open in new tab", well they won't be able to do that.
We need to switch all our div/buttons, anything that navigates, to use
a
withhref
. And then we can add theonClick
anyway and dopreventDefault
to prevent the link from opening in a new URL. This way, the link doesn't trigger from the click, but at the same time it's following html spec and the browser gives you the "open in new tab" buttons and it's better for the visually impaired.