Skip to main content
corrected spelling, enhanced readability in example
Source Link
rwg
  • 934
  • 9
  • 13

I don't know about the bind aspect, nutbut this seems to work for me

 $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) { alert('hi''hi, you just pressed ctrl-z'); } }); 

full code here:

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $(document).ready(function () { alert('1st'); }); $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) {   alert('hi''hi, you just pressed ctrl-z'); } }); </script> </head> <body> 

I don't know about the bind aspect, nut this seems to work for me

 $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) { alert('hi'); } }); 

full code here:

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $(document).ready(function () { alert('1st'); }); $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) { alert('hi'); } }); </script> </head> <body> 

I don't know about the bind aspect, but this seems to work for me

 $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) { alert('hi, you just pressed ctrl-z'); } }); 

full code here:

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $(document).ready(function () { alert('1st'); }); $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) {   alert('hi, you just pressed ctrl-z'); } }); </script> </head> <body> 
Source Link
rwg
  • 934
  • 9
  • 13

I don't know about the bind aspect, nut this seems to work for me

 $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) { alert('hi'); } }); 

full code here:

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $(document).ready(function () { alert('1st'); }); $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) { alert('hi'); } }); </script> </head> <body>