From the course: HTML & CSS: Creating Forms

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Attributes used in forms

Attributes used in forms - HTML Tutorial

From the course: HTML & CSS: Creating Forms

Start my 1-month free trial

Attributes used in forms

- [Instructor] Attributes are used to add additional information and browser instructions to an element in HTML. In this video, we will look at some of the most common attributes you will use when creating forms, but many of the other HTML attributes may be relevant for forms. Some of these attributes in this video are ones we've covered in previous videos. The first attribute is type, and this is used on the input element, because there's more than one type of input. For example, text, number, or date. The type attribute is required on the input field. The next attribute is name. And this can go on the input, select, or text area element. It labels the data when it's sent to the server or database, or however the data is processed, and you can think of it like the column name in the database. Each name in a form should be unique. This isn't shown to the user. You use the label element to tell the user what goes in each field in the form. You need to include this on every input…

Contents