Personally I like to use double quotes on HTML attributes/values, but I have seen codes where the use of single quotes is what predominates over the document and even! some without quotation marks.
<input type="text" name="age" />
<input type='text' name='age' />
<input type=text name=age />
Apart from knowing the compatibility of its use with browsers, I would like to know which of these forms to use and why? are there any functional implications that affect performance?
Example:
In many programming languages; The difference between single and double quotes to declare text strings is the interpolation, but it is unnecessary to discuss that about HTML since we know it does not fall into that category. But is there any behavior that alters the way the data is presented?
Summary
Double quotes are used since in the early days of the markup language ( SGML ), authors could make use of special characters (which were sometimes difficult, if not impossible, to enter via the keyboard) just by typing their reference, p. e.g.:
"&lt;"
represents the sign<
."&gt;"
represents the sign>
."&quot;"
represents the sign"
."&#229;"
(in decimal) represents the lettera
with a small circle on it.In short, like some programming languages, they had rich functionality compared to single quotes.
Source: W3C - HTML4 .
Explanation
The official W3C document (on HTML5 syntax) states that the use of the attribute-value pair with single quotes, double quotes or even without quotes is perfectly correct; Sure! each with certain rules.
Attribute value without quotes
Attribute value with single quotes
Attribute value with double quotes
Derived from all this (and probably custom) the W3C uses double quotes or without quotes in its examples , it is for convenience and sometimes good practice to promote the same thing that the official documentation urges you to do based on its examples, do what Otherwise it is like trying to cut down a tree, going against the grain of the wood.