HTML Attributes

Use HTML Attributes

Attributes provide additional information about HTML elements. Attributes are always specified in the start tag.

Attributes are defined by name/value pairs like: name="value".

Defining Attribute Values

Attribute values should always be enclosed within quotation marks. We can use " or '.

The double quotes and single quotes must come in pair.


name="value"

and


name='value'

are the same.

While


name="value'

are not allowed.

However we can use single quote to contain double quote.


name='This is a "test".' 

or use double quote to include single quote


name="This is a 'test'."