It works even history.go(-1) also...
For Chrome, IE, Mozilla i tested, works fine. use below code:
<a href="#" onclick="history.go(-1);return false;" style="text-decoration:underline;">Back</a>
Finally working solution, tested in IE, FF, Safari, Chrome, Opera, Maxthon:
<a href="#" onclick="window.history.back();return false;">Back</a>
Don't forget semicolon after return false;
This is the only thing that works on all current browsers:
<script>
function goBack() {
history.go(-1);
}
</script>
<a onclick="goBack()">Back</a>