0

I would like to be able to trigger an alert box when the user presses ALT+v.

Using a function similar to this:

$(document).ready(function() {
        $("body").keypress(function(event) {
            if (event.which == alt+v) {
            alert('text to display in alert box');
        }
    });
});
Matt
  • 1,561
  • 5
  • 26
  • 61

1 Answers1

1

Figured out the answer:

$(document).keydown(function (e) {
    if (e.keyCode == 113) {
        alert("alert text");
    }
});
Matt
  • 1,561
  • 5
  • 26
  • 61