If you are programming a fancy typing interface for your web application you will without a doubt need to find out when a user has actually pressed the shift key. It's the only way after all for your application to then decide when to type small or large letters.
Here then is how the above code can be called upon through a onkeypress event. If the shift key is held down while a normal key on your keyboard is pressed, you will see the message The shift key was pressed. Otherwise you will read The shift key was NOT pressed.
var status = document.getElementById("status");
status.innerHTML = "The shift key was pressed!";
status.innerHTML = "The shift key was NOT pressed!";