问题
In Microsoft Edge, when you touch and hold a link, a native tooltip is displayed showing the address (href) of the link. For example:
<a href="http://www.google.com">Google</a>
If you tap and hold the link in Edge, a tooltip will pop up saying "www.google.com". I'd like to prevent this tooltip from displaying.
I've tried catching the MSHoldVisual
and contextmenu
events and calling event.preventDefault()
for them, as recommended for IE 10 on MSDN and by another Stack Overflow question (Is it possible to disable tooltips for links?). But both of those deal with IE 10, and the solution doesn't work for Edge.
I've also determined that removing the href entirely can prevent the tooltip from showing up, but that's not feasible for my scenario.
Are there any other known ways to prevent this tooltip in Edge?
来源:https://stackoverflow.com/questions/37470062/how-to-disable-native-tooltip-for-links-in-microsoft-edge