How to make a Go-Back Input button with inline JavaScript

You are here: Home » Blog » Computer Programming Languages » JavaScript » How to make a Go-Back Input button with inline JavaScript

How to make a Go-Back Input button with inline JavaScript

How to make a Go-Back Input button with inline JavaScript – Now some things to note. All browsers today have a back button so adding one to your site might be unnecessary.

However, as the designer you decide what’s necessary.

<input type="button" value="Go Back From Whence You Came!" onclick="history.back(-1)" />

We use the input type as button, label our button with “Go Back From Whence You Came!”, then using the onclick attribute we use the history.back(-1) value which tells our browsers go back 1 in history.

Definition and Usage

The back() method loads the previous URL in the history list.

This is the same as clicking the “Back button” in your browser, or history.go(-1).

Note: This method will not work if the previous page does not exist in the history list.

Tip: To load the next URL in the history list, use the history.forward() method.


Related Videos:

MiltonMarketing.com Related Videos.

Related Posts:

Systematic approach to Problem Solving

My little pony learning game in VB.NET

Introduction to JavaScript

Introduction to JavaScript – Control Flow: True and False values

Introduction to JavaScript – Control Flow

Introduction to JavaScript – Review Types and Operators

Using the Current Year in Your Posts – WordPress

How do I install plugins in WordPress?

Learn Python Lists

Methods of teaching programming

Introduction to JavaScript – Variables: Review

Introduction to JavaScript – Variables: Undefined

Python Serialization (JSON)

Introduction to JavaScript – Control Flow: if/else Statements

Introduction to JavaScript – Built-in Methods

Learn more about JavaScript Variables

How to Update: Automatically create media_buttons for shortcode selection

Introduction to JavaScript – Create a Variable: let

CODING WITH CSS: The style attribute

Introduction to JavaScript – Variables: String Interpolation

Tips and Tricks for WRITING JAVASCRIPT code

Adding Python Comments

Introduction to JavaScript – Variables: String Interpolation II

HTML paragraph tag: p

Introduction to JavaScript – Libraries

Introduction to JavaScript – Variables: String Interpolation II

Introduction to JavaScript – Libraries

How to make a go-back button with PHP code?

Why do most sites use cookies?

Who is this Android App Development course for?

FAQs
 

By |2019-02-08T19:16:38-05:00April 29th, 2018|Categories: Computer Programming Languages, JavaScript|Tags: , , , |

About the Author:

I am a loving father, & husband. I am a computer enthusiast. I have used and enjoyed computers since I was young and I enjoy teaching young minds how to code, because it teaches them how to think. Today with YouTube, and social media garbage our youth are losing the ability to think on their own and solve problems. I believe this is a serious epidemic as kids today dont understand that technology is a tool. This tool is being abused, and its underlying effects are taking its toll on kids behaviour, and learning.