Browser Back Button

Code Crumbs

General

</ head>

</ body>

<!-- Browser Back Button -->
<script>
$( document ).ready(function() {
	$( ".back-button__class-name" ).click(function() { // Create any class name between the " ". Then add this class name to any back button on that page.  
		window.history.back();
	});
});
</script>

HTML/Embed

Author
Noah Raskin
Published
Feb 4, 2020

How to use:

This code crumb is super simple to use. Simply place this snippet into the footer custom code section on any page you have/need a back button on. If you would like it global to reduce the amount of times it is pasted, then just add it in the footer custom code section within your site settings.

You'll see a class name in the snippet by default named ".back-button__class-name" which you can change to anything you want like "back-button" or "back-link" etc. Once you've done that just add that class to any back button you have and that's it.

This short JQuery code crumb will allow you to add make any button (your dedicated back button) return the user to the previous page using the browser history.

Clone Project
Documentation
Author:
Contributor Crumbs
Built by
Built with
Thank you! Your submission has been received!
Close Form
Oops! Something went wrong while submitting the form.
Become a Contributor