How to implement browser forward and backward functions for web form buttons

Frontend 2021-08-14 19:45:19 0 7,094

Browser functions such as forward and backward can be implemented through simple events triggered by form buttons. For example, add an onclick event to the form and then add JavaScript code to the event.

<input type = "button" name = turnBack" id = "turnBack" value = "turnBack" onclick = "JavaScript:window.history. go(-1);"/>

Your opinion

Already have 0 Article answer