back button JavaScript

Javascript has window.history.back() function which lands you to the previous page, where you clicked to come to this page. Example :

Example

<html>
<head>
<script>
function goBack()
  {
  window.history.back()
  }
</script>
</head>
<body>
	the quick brown red fox jumps over the lazy dog. 
        the quick brown red fox jumps over the lazy dog. 
        the quick brown red fox jumps over the lazy dog. 
        the quick brown red fox jumps over the lazy dog. 
        the quick brown red fox jumps over the lazy dog. 
        the quick brown red fox jumps over the lazy dog. 
        the quick brown red fox jumps over the lazy dog.

	<button value="Back" onclick="goBack()"
		style="border: 0; background: transparent; position: fixed; 
                bottom: 50px; right: 50px;">
		<img src="back.png" alt="back" />
	</button>

</body>
</html>