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