How to Disable the CTRL+P using javascript or Jquery?

后端 未结 11 1039
一生所求
一生所求 2020-12-31 06:17

Here I tried to disable the Ctrl+P but it doesn\'t get me alert and also it shows the print options

jQuery(document).bind(\"keyup keydo         


        
11条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-31 06:34

    Try this

        //hide body on Ctrl + P
        jQuery(document).bind("keyup keydown", function (e) {
            if (e.ctrlKey && e.keyCode == 80) {
                $("body").hide();
                return false;
            }
        });
    

提交回复
热议问题