How to create a back button in html?

I want to add a back button in my website.Once visitor click on that button  will direct  back to the page.

Senior Developer Asked on January 25, 2017 in HTML.
Add Comment
2 Answer(s)

Try this one


<button onclick="GoBack()">GO BACK</button>
<script>

function GoBack () {

window.history.back();

}

</script>

Team Leader Answered on January 26, 2017.
Add Comment

Just add the below code in your webpage. In the below  code the -1 tells the browser to go back one page.

 

<form>
<input  type="button" value="Back" onClick="history.go(-1);return true;">
</form>

 

Team Leader Answered on January 26, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.