HTML 5 Programming and Web development/HTML 5 Attributes

HTML 5 attributes are created using a name-value pair and are placed after the tag name.

Name-value pairs
Name-value pairs are represented by a set of text strings in which  are usually separated by commas, semicolons, space or newline character.

Writing HTML 5 Atrributes
HTML 5 attributes are written inside the element's tag and separated by spaces. For example: In this code the attributes are type and value and their values are "text" and "hello Web" respectively.

Attributes give extra information about an element. For example, in the input element the attribute type gives the type of input, so if we had  we would get a button instead of a textbox. Attributes are very important in HTML and without them Web development would probably be much harder.

Special Attributes
HTML 5 has some special attributes that I must point out.

The id attribute
The id attribute is a unique identifier for the element. It becomes very useful when using CSS and JavaScript. You cannot have more than one element with the same id on a web page. Here is an example of the id attribute:

The class attribute
The class attribute groups an element with other elements of the same class. This is often used to apply CSS styles to elements. Unlike with the id attribute, you can have more than one element with the same class on a page.