Window history.back() పద్ధతి

Definition and usage

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

history.back() The method is valid only when there is a previous page.

Note:

history.back() With history.go(-1) Same.

history.back() Same as clicking the 'back' button in the browser.

See also:

history.forward() method

history.go() method

history.length method

Example

Create a 'back' button on the page:

<button onclick="history.back()">Back</button>

The output of the above code will be:

Click 'back' to see how it works.

(Valid only when the previous page exists in your history list)

Try it yourself

Syntax

history.back()

Parameter

None.

Return value

None.

Browser support

All browsers support history.back():

చ్రోమ్ ఐఇ ఎడ్జ్ ఫైర్ఫాక్స్ సఫారీ ఒపెరా
చ్రోమ్ ఐఇ ఎడ్జ్ ఫైర్ఫాక్స్ సఫారీ ఒపెరా
మద్దతు మద్దతు మద్దతు మద్దతు మద్దతు మద్దతు