HTML <input> align Attribute

Example An HTML form with an image as a submit button. The submit button is aligned to the right: <form action=”/action_page.php”> First name: <input type=”text” name=”fname”><br> <input type=”image” src=”submit.gif” alt=”Submit” align=”right” width=”48″height=”48″> </form> Try it Yourself » Definition and Usage The align attribute is only used with <input type=”image”> and it specifies the alignment of the image input according to surrounding elements. Browser Support […]

HTML <button> type Attribute

Example Two button elements that act as one submit button and one reset button (in a form): <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” value=”Submit”>Submit</button> <button type=”reset” value=”Reset”>Reset</button> </form> Try it Yourself » Definition and Usage The type attribute specifies the type of button. Tip: Always specify the type attribute for the <button> element. Different browsers may use different default […]

HTML <button> form Attribute

Example A button located outside a form (but still a part of the form): <form action=”/action_page.php” method=”get” id=”form1″> First name: <input type=”text” name=”fname”><br> Last name: <input type=”text” name=”lname”><br> </form> <button type=”submit” form=”form1″ value=”Submit”>Submit</button> Try it Yourself » Definition and Usage The form attribute specifies one or more forms the button belongs to. Browser Support The numbers in the table specify the first browser version that fully supports […]

HTML <input> Tag

Example An HTML form with three input fields; two text fields and one submit button: <form action=”/action_page.php”> First name: <input type=”text” name=”fname”><br> Last name: <input type=”text” name=”lname”><br> <input type=”submit” value=”Submit”> </form> Try it Yourself » Definition and Usage The <input> tag specifies an input field where the user can enter data. <input> elements are used within a <form> element to declare input controls that […]

HTML Form

This section will teach you the basics of HTML forms in detail. HTML Forms HTML Forms HTML Form Elements HTML Input Types HTML Input Attributes