How do I capture a CTRL-S without jQuery or any other library?

前端 未结 7 477
别那么骄傲
别那么骄傲 2020-12-09 04:44

How do I go about capturing the CTRL + S event in a webpage?

I do not wish to use jQuery or any other special library.

Thanks for your

相关标签:
7条回答
  • 2020-12-09 05:27

    Add Shortcuts JS library and do the following code :

    <script src="js/libs/shortcut/shortcut.js" type="text/javascript"></script>
    

    Then

    shortcut.add("Ctrl+S", function() {
                alert("لقد قمت بالصغط على مراقبة مع حرف السين");
            });
    
    0 讨论(0)
提交回复
热议问题