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?
  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.

  • 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? 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/… 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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