Javascript DOM HTML Input Text handle mouse down event

Description

Javascript DOM HTML Input Text handle mouse down event

View in separate window

<!DOCTYPE html>
<html>
<body>
<input type="text" size="40" onmousedown="myFunction(event)">
<p id="demo"></p>
<script>
function myFunction(event) {/*w ww  .  j a  v a  2 s .c  o m*/
  var x = event.getModifierState("CapsLock");
  document.getElementById("demo").innerHTML = "Caps Lock activated: " + x;
}
</script>

</body>
</html>



PreviousNext

Related