简体   繁体   中英

How can I call two functions by pressing F11?

I am creating a webpage for science fair to test student's abilities to detect a phishing website. The website will change to look like the Windows log in screen. I need the functions that do this to activate when F11 is pressed. how might I do this?

I'd suggest not using the F11 key, as this is a common shortcut for launching the "full screen" mode in some current browsers. Hence, the browser developers may want to protect the browser from a page author overriding this shortcut.

$(document).keyup(function(e){
    if(e.keyCode===122){
        function1();
        function2();
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM