I have two divs in which there are buttons to do certain action: on first button click I want this button to hide and another to show. If i click on the new button it should hide the button and come back to the first one. It's working perfectly fine however I would like to add action for browser "back" button so it works the same way as I would click the 2nd button when the user is after first action.
<div class="firstdiv">
<a class="gototwo"> Go to Step 2 </a>
</div>
<div class="seconddiv" style="display:none">
<a class="gotofirst"> Go back to Step 1 </a>
</div>
Working fiddle here: https://fiddle.jshell.net/Lp6yjux7/
I've been reading it's possible to prevent default action but I don't know how to implement it in the jquery code I already have.