IE and Chrome are compatible with the Enter event, and iechrome is compatible with the enter event.

Source: Internet
Author: User

IE and Chrome are compatible with the Enter event, and iechrome is compatible with the enter event.

Chrome compatible return key code:

Document. onkeydown = function (event) {// press enter to send the message var e = event | window. event | arguments. callee. caller. arguments [0]; if (e & e. keyCode) {// enter key // ToDo e. preventDefault (); // prevents the enter key from bubbling and enters a line feed }};

The IE-compatible enter key code:

Document. onkeypress = function (e) {var code; if (! E) {var e = window. event;} if (e. keyCode) {code = e. keyCode;} else if (e. which) {code = e. which;} if (code = 13) {// ToDo: return false, which calls the execution method. // The return key event is blocked}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.