Answers for "how tu use a html button to open a link"

5

add link behind a button in html

<!DOCTYPE html>
<html>
   <head>
      <title>Title of the document</title>
   </head>
   <body>
      <form>
         <input type="button" onclick="window.location.href = 'https://www.w3docs.com';" value="w3docs"/>
      </form>
   </body>
</html>
Posted by: Guest on May-13-2020
1

href in button

<input type="button" onclick="location.href='https://google.com';" value="Go to Google" />
Posted by: Guest on December-27-2020

Code answers related to "how tu use a html button to open a link"

Browse Popular Code Answers by Language