ShiftKey not working on formsubmit
by David Refoua
HTML
<script>
function isPressed(e){
alert(e.shiftKey); //returns undefined instead of true|false -_-
}
</script>
<form onsubmit="isPressed(event); return false;">
<u>Hold shift down</u> and then
<input type="submit" value="Click here to submit" />
</form>
<small>(This should <i>not</i> return <code>undefined</code>.)</small>
CSS
body{
margin-top: 100px;
background: #252525;
}
body, input{
line-height: 15px;
text-align: center;
font-family: sans-serif;
font-size: 11pt;
font-weight: bold;
color: white;
text-shadow: 0 2px black;
padding: 15px;
vertical-align: middle;
}
input{
-webkit-transition: .2s ease;
-moz-transition: .2s ease;
-ms-transition: .2s ease;
-o-transition: .2s ease;
transition: .2s ease;
background: #125aed;
outline: 0; margin: 0 20px;
border: 2px solid black;
border-radius: 4px;
box-shadow: inset 0 1px rgba(255,255,255,.3), 0 2px 5px rgba(0,0,0,.3);
}
input:hover{
background: #1233ef;
}
input:active{
background: darkblue;
box-shadow: 0 1px rgba(255,255,255,.3);
}
small{
color: #ddd;
margin-top: 50px;
padding: 10px 0;
display: block;
font-weight: normal;
background: #222;
text-shadow: 0 1x black
}
/* I've designed this just for fun! ;) */