Answers for "how to give a button a herf"

4

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

html button click url

# Wrap whole button in a 'a' tag.
 <a href="https://google.com" class="button"><button class="pixel">Button text</button></a>
Posted by: Guest on October-25-2020

Browse Popular Code Answers by Language