Home » How To Add Back Button In Elementor

How To Add Back Button In Elementor

Last updated on June 6, 2021 by

Often, the client wants to add a back button in Elementor because the back button can be a handy feature for the users to go back to the last screen easily. It is also good for the user experience. So let’s add a back button in Elementor step by step.

Add Back Button

  1. Drag & Drop the Button widget onto your page, wherever you’d like to place it
  2. Go to the Button widget’s Advanced tab, enter a name into the CSS ID field, such as 'btn-back' as shown in the following screenshot
  1. Don’t forget to click on the “Update” button
  2. Now, add the following code into your JavaScript file. If you don’t know how to place the JavaScript code in your WordPress then follow step 5 & 6 else skip that. The developer knows how to place code but what if you are not a technical person. That’s why I will show you how you can place your JavaScript or CSS code in WordPress.
<script type="text/javascript"> 

jQuery(document).ready(function() {
    jQuery('#btn-back').on('click', function() {
      window.history.go(-1); 
      return false;
    });
});

</script>
  1. To place JavaScript code in WordPress, you need to install and activate the Insert Reply