In an onclick handler, how can I detect whether shift was pressed?

You can look at the click event’s shiftKey property.

window.addEventListener("click",
  function(e) {
    if (e.shiftKey) console.log("Shift, yay!");
  },
  false);
<p>Click in here somewhere, then shift-click.</p>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)