Javascript examples for DOM Event:onkeypress
Check if the control key is pressed in click event
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function doAjax(e) {/* w ww . jav a 2s . c om*/ 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>