This has been haunting me for a while now.

While one might think that is a easy thing to do, just listen to the keydown og keyup event, og even using jquery’s keypress event and adding a

preventdefault on the event, or returning false – then youre done. ­čÖé

But hey – NOT working on the ┬ámobile chrome browser.

So it seems that anothe technique must be used.

After a long trial and error period, i came across a new event called input

And voila:

var your_element = document.getElementById('your_element');
your_element.addEventListener('textInput', function(e) {

  if ( == 32) {
     return false;
  return true;