This article describes how JavaScript prevents the browser from returning to the button. Share it for your reference. The specific analysis is as follows:
The following JS code can prevent users from clicking the return button, which is very practical. Friends who need it can collect it.
<SCRIPT type="text/javascript"> window.history.forward(); function StopBack() { window.history.forward(); }</SCRIPT></HEAD><BODY onload="StopBack();" onpageshow="if (event.persisted) StopBack();" onunload="">I hope this article will be helpful to everyone's JavaScript programming.