From the course: HTML and CSS: Creating Forms

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Buttons

Buttons

- [Instructor] Every form needs a submit button. There are two main ways to create buttons on forms using the submit input type or the button element. The button element is generally preferred because it's more flexible as far as being able to style it. But we'll start with the more basic submit input type. We already added a submit button in an earlier video using input with a type=submit. If you don't specify, the browser will use the default button text, which can vary. For example, you see here it's Submit Query in Firefox. In Safari, it's submit. If you want different button text, you can add a value attribute. You can only add plain text here, so there isn't much flexibility. So for an order form, I might want the button to say Place Order. So I would just go to the input element, value="Place Order" and save and refresh in the browser. Now I have the new button text. You can use other words as appropriate, but make sure it's clear to the user what will happen when they click…

Contents