how to redirect to another page in html on button click?

how to redirect to another page in html on button click – To make Submit button redirect to another page we can use HTML Form Tags.

how to redirect to another page in html on button click

Which will allow us to Redirect or Open another Webpage using Submit button Click. Example 1: html button redirect For button redirection you can use below code:

How to Make Submit button redirect to another page in HTML?

Redirect using HTML Forms

<html>
   <head>
     <title>Submit Button Redirect</title>  
   </head>    
    <body>     
     <form method="POST" action="myPage.php">  
       <input type="submit"/>  
     </form>    
    </body>    
</html>

Link Submit button using Anchor Tags in HTML

<html>    
   <body> 
     
     <a href="https://www.pakainfo.com">  
      <input type="submit"/>  
     </a>
     
   </body>    
</html>

Link Submit button to Another page using JavaScript

<html>    
  <body> 
   
   <input type="submit" onClick="getInformation()"/> 
   <script>
     function getInformation() {
       window.location.href="https://www.pakainfo.com";  
     }
   </script>
   
  </body>    
</html> 

JavaScript button to another site

<button onClick="window.location.href='https://www.pakainfo.com';">  
Use Software  
</button>    

Redirect using HTML Form Tags

<html>
     
    <body> 
     
     <form action="nextpage.php" method="POST">  
       <input type="submit"/>  
     </form>
     
    </body>
     
  </html>

Redirect using HTML Anchor Tags

<html>
   
  <body> 
   
   <a href="https://www.pakainfo.com">  
     <button>Use Software</button>  
   </a>
   
  </body>
   
</html>

how to make a button or a page link to another page in HTML using the button?

<html>
   
  <body> 
   
   <a href="https://www.pakainfo.com">  
     <button>Use Software</button>  
   </a>
   
  </body>
   
</html>

how to handle multiple submit buttons in HTML forms?

<html>
   
  <body> 
   
   <input type="submit" id="submitBtn"/>  
    <script>
     document.getElementById("submitBtn").addEventListener("click", getInformation);  
     function getInformation() {  
       window.location.href="https://www.pakainfo.com";  
     }
    </script>
   
  </body>
   
</html>

a href Submit form onclick

<html>
   
  <body> 
   
   <a href="myNextPage.html">  
     Use Software 
   </a>
   
  </body>
   
</html>

redirect to another page after form submit HTML

<html>
   
  <body> 
   
   <form method="POST" action="welcome_page.php">  
    <input type="text"/> 
    <input type="submit"/> 
   </form>
   
  </body>
   
</html>

button type submit redirect to another page

<a href=“yourPathHere“>
Your Button Here..
</a>

<form action=”YourPathHere”>
<input type=”submit”/>
</form>

Example 1 : button type submit redirect to another page

<html>
<body>
 
  <a href="https://www.pakainfo.com">  
    <input type="submit"/>  
  </a>
 
</body>
</html>

Example 2: Button Type Submit redirect

<html>
<body>
 
  <form action="https://www.pakainfo.com">  
    <input type="submit"/>  
  </form>
 
</body>
</html>

html button click redirect

<html>
<body>
 
  <a href="https://www.pakainfo.com">  
    <button>Use Software</button>  
  </a>
 
</body>
</html>

Don’t Miss : How To Redirect From One Page To Another In Html On Button Click?

I hope you get an idea about how to redirect to another page in html on button click.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.