Reputation: 541
I import an svg file inside a html5 page. For mouse events we have the attribute pointer-events that we can set to false to stop events but there is not any equivalent attribute for keyboard events. I have a js functions "document.onkeydown" that I want to be able to prevent from firing. Any help?
Upvotes: 0
Views: 93
Reputation: 306
just add a listener for the respective events and return false.
document.onkeydown = document.onkeyup = document.onkeypress = function (e){
return false;
}
Upvotes: 1