Click press enter to implement the button clicking function. Press enter to implement the button and click

Source: Internet
Author: User

Click press enter to implement the button clicking function. Press enter to implement the button and click

Click press enter to implement the button clicking function:
In practical applications, you may need to click a button to execute a function. This function can also be implemented when you press Enter, that is to say, when you press enter, the click event is also triggered. The following describes how to implement this function through code instances.
The Code is as follows:

 

<! DOCTYPE html> 

 

The above Code meets our requirements. You can click the button or the return car to set the background color of the div to blue.
Related reading:
1. For details about click events, see click events in jQuery.
2. For details about the css () function, see the css () method section of jQuery.
3. For details about keydown events, refer to the keydown Events section of jQuery.
4. For more information about keyCode attributes, see section keyCode attributes in javascript.
5. For more information about wihich attributes, see event. which attributes in jQuery.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 12399.

For more information, see: http://www.softwhy.com/jquery/

 

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.