Can anyone tell me how to link a button to go back to previous page?
Staff replied
SP Page Builder
Previous page button / go back
2 replies
Paul Frankowski Senior Staff
3 years ago
· edited
Hi Ernst,
If you don't know previus URL - by default is not possible, becuase you have to put URL.
But you can always use HTML code inside Raw HTML addon, here is example code:
<button onclick="history.back()">Go Back</button>
Yes, supported by all popular browsers.
Paul Frankowski Senior Staff
3 years ago
· edited
Preceding your 2nd question about whether the bg color of the button can be different, of course, you can specify it using button class names, for example, Bootstrap 5.x custom button styles:
<button class="btn btn-primary" onclick="history.back()">Go Back</button>
<button class="btn btn-secondary" onclick="history.back()">Go Back</button>
<button class="btn btn-info" onclick="history.back()">Go Back</button> Log in to reply.