HTML <button> formenctype Attribute

Example A form with two submit buttons. The first submit button submits the form data with default character encoding, and the second submits the form data without character encoding: <form action=”/action_page_binary.asp” method=”post”> Name: <input type=”text” name=”fname” value=”Ståle Refsnes”><br> <button type=”submit”>Submit with character encoding</button> <button type=”submit” formenctype=”text/plain”>Submit without character encoding</button> </form> Try it Yourself » Definition and Usage The formenctype attribute specifies how form-data should […]

HTML <button> formaction Attribute

Example A form with two submit buttons. The first submit button submits the form data to “action_page.php”, and the second submits to “action_page2.php”: <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><br> <button type=”submit” formaction=”/action_page2.php“>Submit to another page</button> </form> Try it Yourself » Definition and Usage The formaction attribute specifies where to send the form-data when a form is submitted. […]

HTML <button> autofocus Attribute

Example A button with autofocus: <button type=”button” autofocus>Click Me!</button> Try it Yourself » Definition and Usage The autofocus attribute is a boolean attribute. When present, it specifies that a button should automatically get focus when the page loads. Browser Support The numbers in the table specify the first browser version that fully supports the attribute. Attribute autofocus […]

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 […]