Javascript examples for DOM HTML Element:Anchor
Stop <a> click event without holding control key
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function doAjax(e) {/* ww w .j a v a 2 s. co m*/ if (!e) e = window.event; if (!e.ctrlKey) { console.log("Ajax code here"); return false; } } </script> </head> <body> Here is a <a href="/link/location" onclick="return doAjax(event);">link</a> </body> </html>