window.onkeypress = function(event) { return event.keyCode != 8; }
This binds the onkeypress event to a function that returns false if the keyCode is equal to 8 (which is backspace). Returning false on an event usually (always?) makes the browser ignore any further consequences of the event.