1.onkeypress&onkeydown differences
The onkeypress event occurs when the user presses and releases any alphanumeric keys. However, the system buttons (for example: arrow keys, function keys) cannot be identified.
The onkeydown event occurs when the user presses any keyboard key, including the system button. The captured keycode do not differentiate between letter sizes, but onkeypress.
IE6 's onkeypress will accept the "carriage return event", and OnKeyDown will not accept
IE8 's onkeypress will not accept the carriage return event, and OnKeyDown will accept
In Firefox, onkeypress and onkeydown All accept the "carriage return event".
function // var e = e | | If//13 for carriage return //TO_DO Press ENTER after action </script>
In the HTML source code, at the same time use the onkeypress, onkeydown, but said above, Firefox accepts carriage return event, in order to make it run only once, then any one event incoming parameter event, the other one does not pass parameters.
Finally, complete the compatible ie&firefox.
JavaScript text box, determine Enter trigger event compatible Ie&firefox