HTML <button> formmethod Attribute

Example A form with two submit buttons. The first submit button submits the form data with method=”get”, and the second submits the form data with method=”post”: <form action=”/action_page.php” method=”get”> First name: <input type=”text” name=”fname”><br> Last name: <input type=”text” name=”lname”><br> <button type=”submit”>Submit</button> <button type=”submit” formmethod=”post”>Submit using POST</button> </form> Try it Yourself » Definition and Usage The formmethod attribute specifies which HTTP method to use when sending the […]

HTML <button> Tag

Example A clickable button is marked up as follows: <button type=”button”>Click Me!</button> Try it Yourself » Definition and Usage The <button> tag defines a clickable button. Inside a <button> element you can put content, like text or images. This is the difference between this element and buttons created with the <input> element. Tip: Always specify the type […]