Button playing the same role of browser arrow

Asked

Viewed 40 times

1

I would like to know if there is the possibility of a button do the same role of the "back" arrow of the browser ? Go back to the previous page without refreshing the page ?

1 answer

2


Yes, in this way:

<input type = 'button' value = "Voltar" onclick = 'javascript:history.back(-1)'>
  • And in a input type="submit" do the same, keep the previous page in the same place but give the refresh ?

  • onclick = 'NOME_DA_SUA_PAGINA.html'

  • So it refreshes and goes back to the top of the page would have no way to refresh and keep in the same place it was ?

  • If you want to go back to some specific point in a form, put an autofocus in the field attributes. Other than that, every time the page opens it will load the beginning of it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.