I cannot get preventDefault() to work.
preventDefault()
Here are some different code variations I have tried:
First:
$(document).keyup(function (evt)
There is no default behaviour for .keyup(); it fires after the key press which triggers the default behaviour. Use .keydown() or.keypress()` instead.
.keyup()
.keydown() or
source: http://api.jquery.com/category/events/keyboard-events/