how to bind key combination ctrl+x+return in jquery

后端 未结 5 575
闹比i
闹比i 2021-01-02 16:59

Is there any way to catch key combination ctrl+x+return in jquery(or javascript), such that if user presses this key combination, a function

5条回答
  •  执笔经年
    2021-01-02 17:58

    simply just type like this:

        document.getElementById('yourelementid').onkeydown = function(){
           if(event.ctrlKey===true && event.keyCode==88){
               //your code goes here
           }
        }
    //no depedency needs. pretty straight-forward
    

提交回复
热议问题