0

我希望能够在用户按下 ALT+v 时触发警报框。

使用与此类似的函数:

$(document).ready(function() {
        $("body").keypress(function(event) {
            if (event.which == alt+v) {
            alert('text to display in alert box');
        }
    });
});
4

1 回答 1

1

想出了答案:

$(document).keydown(function (e) {
    if (e.keyCode == 113) {
        alert("alert text");
    }
});
于 2013-06-19T18:16:51.610 回答