Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can create an HTML button that sends data to a different URL by using a form with a POST method.

Here's an example:

<form action="http://example.com" method="POST">
  <input type="text" name="username" placeholder="Username">
  <input type="password" name="password" placeholder="Password">
  <button type="submit">Submit</button>
</form>

In this example, when the button is clicked, the data entered in the form (the username and password) will be sent to the URL specified in the action attribute using the POST method. You can replace the URL with the one you want to send the data to.