Home>Article>Web Front-end> How to implement button click to jump in javascript
Method: 1. Add the "onclick="location.href='//m.sbmmt.com/m/faq/url'"" statement to the button element to jump. 2. First bind the click event to the button element; then specify the function that will be executed when the click event is triggered; finally, in the execution function, use the "location.href" statement to set the jump function.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
Method 1: Uselocation.href
directly on the button element to jump
Method 2: Give Bind the click event to the button element and jump
Document
[Recommended learning:javascript advanced tutorial]
The above is the detailed content of How to implement button click to jump in javascript. For more information, please follow other related articles on the PHP Chinese website!