Have to say, in the JS aspect, oneself really is a genuine rookie. For JS and some JS framework such as jquery JS frame, oneself is just in the stage of simple application, of course, oneself also in continuous learning, hope in the future can share with you more JS experience. Let's start with an appetizer today. How to set a default button, that is, whether the focus is not on the button, just press ENTER, it is equal to trigger the button click event.
The code is very simple, just a few lines of code to complete this function:
Well, it seems a little too simple, so complete a blog, I am a little embarrassed. Finally, we enclose an example of a small program:
<! DOCTYPE html>
This small example is very simple, the code is very understood, but the thing behind the code is not common people can understand. Please raise your hand if you can understand.
Rookie Learn JS (four)--javascript for the button to register the return event (set the default button)