function EnterPress(){ if(event.keycode == 13){ ... } }
IE6’s onkeypress will accept the "Enter event" , and onkeydown will not accept IE8's onkeypress will not accept "Enter event", but onkeydown will accept ... Don't worry about this, just write both
However, when it comes to FF, there will be contradictions. FF accepts "Enter events" onkeypress and onkeydown. At the same time, in order to be compatible with FF, it can be obtained below event, you need to write it like this:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn