<p>Click anywhere to test the <code>shiftKey</code> property.</p>
<p id="log"></p>MouseEvent: shiftKey property / notebook
MouseEvent: shiftKey property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
let log = document.querySelector("#log");
document.addEventListener("click", logKey);
function logKey(e) {
log.textContent = `The shift key is pressed: ${e.shiftKey}`;
}