Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am wondering about the following questions for HTML5

  1. <br /> OR <br>? Are all elements the same for the answer?
  2. selected="selected" OR selected?
  3. Are there any other syntax instances that were true for XHTML/HTML4 that are not for HTML5?
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted
  1. <br> in HTML5 <br /> in XHTML5

  2. selected, selected="", and selected="selected" are all valid attributes

  3. Differences between HTML 4 and 5. - From StackOverflow.

share|improve this answer
    
Ah cool, why is w3cschools still using <br /> and <img /> etc...then? –  Metropolis Oct 27 '10 at 2:57
    
I already read over that entire page about the difference between HTML4 and 5, but I never saw where it said the correct way to do this in HTML5? –  Metropolis Oct 27 '10 at 2:58
    
Has using selected/checked/disabled without specifying a value ever been valid? –  Lèse majesté Oct 27 '10 at 2:59
1  
@John: I've always assumed the shorthand was invalid, which is why I specify a value in all of my code. But upon closer inspection of the current revision of the HTML5 specs, it looks like it might actually be valid. They don't explicitly say it anywhere, but in the example code they always use readonly without a value, and while selected is given a value in most places, they use the shorthand here (scroll down a bit): whatwg.org/specs/web-apps/current-work/multipage/… –  Lèse majesté Oct 27 '10 at 3:21
2  
@Lèse majesté - Good link. [here's a great example from that page] that shows exactly what we need to know.(whatwg.org/specs/web-apps/current-work/multipage/…) Going to update my answer accordingly. –  John Conde Oct 27 '10 at 3:24
show 9 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.