3 ms·
One of the examples reminded me of some xml/html trivia I picked up a few years back -- attributes do not need to have double-quotes. (Yes, in practice you can
by Tloewald 12y ago
One of the examples reminded me of some xml/html trivia I picked up a few years back -- attributes do not need to have double-quotes. (Yes, in practice you can leave out quotes altogether if the attribute has no spaces because browsers are tolerant, but the spec allows for single or double quotes, so if you're going to parse markup you need to allow for both.)
It occurred to me that HTML5 might have tightened up this rule, but it remains as before:
http://www.w3.org/TR/html-markup/syntax.html#attribute http://www.w3.org/TR/html-markup/syntax.html#attribute
- cygx 12y agoNote that XML attribute values do need to be quoted, so this is only true for HTML and not XHTML.