javascript - Using Keyup Event Globally - Stack Overflow

admin2025-04-17  0

How would I go about using JavaScript on my web page page to call a function anytime there is a keyup event globally, so it isn't attached to textbox. I need it to work for every key on the keyboard. I am very new to JavaScript and having a lot of trouble interpreting the documentation

How would I go about using JavaScript on my web page page to call a function anytime there is a keyup event globally, so it isn't attached to textbox. I need it to work for every key on the keyboard. I am very new to JavaScript and having a lot of trouble interpreting the documentation

Share edited Apr 30, 2022 at 22:16 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Jul 5, 2012 at 14:53 mwhite14mwhite14 2571 gold badge7 silver badges19 bronze badges 2
  • 1 what have u tried? api.jquery./keyup – GreenGiant Commented Jul 5, 2012 at 14:56
  • Wele to Stack Overflow; please read the faq. Typically questions are acpanied by code. – zzzzBov Commented Jul 5, 2012 at 14:59
Add a ment  | 

1 Answer 1

Reset to default 7

jQuery

$(document).keyup(function() {});

Javascript

document.onkeyup = function(event) {}
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744884422a272452.html

最新回复(0)