Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I try to detect if a user presses F12 or ALT + L.

document.onkeydown = function (event) {
    event = (event || window.event);
    if (event.keyCode == 123 || (event.keyCode == 18 && event.keyCode == 76)) {
        //do anything
        return false;
    }
}

What am I doing wrong?

share

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.