0

This is my login page called login.html and i want to open register.html page in the same tab when pressing register button

This is the page(regeister.html) i want to navigate to when pressing register button in login.html page

Tumisang Pita
  • 11
  • 1
  • 3
  • 1
    Possible duplicate of [Open URL in same window and in same tab](https://stackoverflow.com/questions/8454510/open-url-in-same-window-and-in-same-tab) – a stone arachnid Oct 08 '18 at 00:10

3 Answers3

1

You can use hyperlink to link once page to another

<a href="register.htm">Button</a>

if you using a <form> you can use form action you can try this.

<form action="http://www.register.htm">
<button type=submit>Register</button>
</form>

or onclick method

<input type="button" name="b1" value="Register"
 onclick="location.href='register.htm'">
Poorna Senani Gamage
  • 1,218
  • 1
  • 18
  • 28
0

you can use this too

   <button>
    <a type="button" href="register.html"> register</a>
   </button> 
0

Wrap your register <button> with an <a> tag.

<a href='register.html' target='_self'>
    <button>Register</button>
</a>

Use target attribute to specify where to open the link.

  • _blank = Opens the linked document in a new window or tab
  • _self = (default) Opens the linked document in the same frame as it was clicked
  • _parent = Opens the linked document in the parent frame
  • _top = Opens the linked document in the full body of the window framename

Read more:

Roshana Pitigala
  • 7,945
  • 8
  • 47
  • 71