<p>
Press any character key, with or without holding down the SHIFT key.<br />
You can also use the SHIFT key together with the ALT key.
</p>
<pre id="output"></pre>KeyboardEvent: shiftKey property / notebook
KeyboardEvent: shiftKey property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const output = document.getElementById("output");
function showChar(e) {
output.textContent = `Key KeyDown: "${e.key}"
SHIFT key KeyDown: ${e.shiftKey}
`;
}
document.addEventListener("keydown", showChar);