+ 1
<br> or <br />
Does it matter which way the void elements are written? Such as <hr> and <hr /> or <input> and <type /> I see examples use both alternating, and even in testing, I see no differences in code execution. What's the relevance? https://code.sololearn.com/WYzmLK7oEeFv/?ref=app
7 Réponses
+ 9
Being on the other side of the barricade, I see a difference when parsing a website. Parsers consider <br> and <br/> tags as different, usually. Not to mention they are often confused seeing those tags and classifying them wrong :)
+ 5
Andre Daniel Some parsers may read <br> as an open tag and <br/> as closing tag. If you parse a web based on this rule, you might get unexpected results, as "the line break" is a single-type tag, no matter the actual writing.
+ 4
i don't think there is a difference...
its like the bold tag: you can write <b> or <strong>
+ 2
there are no visual differences, its something like
alert(""); and alert("")
the computer will read it as <br/> but you can just type <br> if you want
+ 1
Roel in some languages, alert("") will return an error since there is no semicolon (;), such as Java. 😅
+ 1
yes, but javascript wont, as it is way more flexible than java :)
0
Kuba Siekierzyński so what do parsers classify them as, in other words, what are the visual differences?