Instructions: Click #a, then click either button.
#a


source
HTML
<a href="#a">#a</a><br>
<button onclick="goBack()">navigation.back(); location.hash = "forward"</button><br>
<button onclick="goBackHistory()">history.back(); location.hash = "forward"</button><br>
JavaScript
function goBack() {
    navigation.back();
    location.hash = "forward";
}

function goBackHistory() {
    history.back();
    location.hash = "forward";
}