I need to do something when a user presses . and something else when an user presses :.
Is there a way to intercept these two keys with JavaScript, jQuery or other?
I need to do something when a user presses . and something else when an user presses :.
Is there a way to intercept these two keys with JavaScript, jQuery or other?
Copyright © 2021 Jogjafile Inc.
Assuming you want to intercept these keys on the whole document:
Marcel Korpel rightly points out in the comments that it's more efficient not to use the
String.fromCharCode()
call; here's a version without: