<html>
<head>
</head>
<body>
<div id='first'>first</div>
<div id='second' style="display: none">second</div>
<a id="back">back</a>
<a id="forward">forward</a>
<script>
get=document.querySelector.bind(document)
first=get("#first")
second=get("#second")
f=function(){
if(this.id==="back") {
first.style.display="block"; second.style.display="none"
}else{
first.style.display="none"; second.style.display="block"
}
}
;[get("#back"), get("#forward")].forEach(function(e){e.onclick=f})
</script>
</body>
</html>