Ask Your Question

How can I create an HTML button that sends data to a different URL?

asked 2021-11-29 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-04-19 21:00:00 +0000

woof gravatar image

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="" method="POST">
  <input type="text" name="username" placeholder="Username">
  <input type="password" name="password" placeholder="Password">
  <button type="submit">Submit</button>

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer

Question Tools


Asked: 2021-11-29 11:00:00 +0000

Seen: 21 times

Last updated: Apr 19 '21