You no longer need to enclose attribute values โ€‹โ€‹in HTML5 with quotation marks?

I am trying to learn HTML5, and I saw some tutorials that do something like:

<input type=email> 

And I noticed that it is different from XHTML, where most values โ€‹โ€‹(if not all) should be enclosed in quotation marks.

Will it have any future things that I should be careful about?

+3
source share
2 answers

I refer you to the specification: http://www.w3.org/TR/html5/syntax.html#attributes-0

Attributes can be specified in four different ways:

  • Syntax Empty Attributes
  • The syntax of a value without quotes
  • Quotation syntax value syntax
  • Double-quoted Attribute Value Syntax
+5
source

HTML never required quoting attribute values โ€‹โ€‹(this is optional). XHTML always required the value of quoted attributes. HTML5 continues this tradition.

+1
source

Source: https://habr.com/ru/post/1480423/


All Articles