Back to Previous Page Button
Add a back to previous page button to your Webflow site with this simple Javascript code snippet. When a user clicks on the button they'll be returned to the previous page they were visiting.
Add a back to previous page button to your Webflow site with this simple Javascript code snippet. When a user clicks on the button they'll be returned to the previous page they were visiting.
How to add it
- Add Javascript code snippet to the closing body section of your custom code
- Update the class to the class name of your button
The code
Javascript
<!-- Add to closing body section -->
<script>
$( document ).ready(function() {
$( ".goback" ).click(function() {
window.history.back();
});
});
</script>