0

Can anyone explain shortly the different meanings of these inputs? 1st one, ended space + slash. 2nd one ended only slash, 3rd one ended no slash. Which is the new method or which is the correct method or are both for different purposes?

<input type="text" id="id" value="some" />
<input type="text" id="id" value="some"/>
<input type="text" id="id" value="some">
hnefatl
  • 5,860
  • 2
  • 27
  • 49
Jeny
  • 35
  • 7
  • Some useful information here: https://stackoverflow.com/questions/38498799/input-tag-html-with-close-tag-or-not – Robert Wade Oct 15 '17 at 22:08

1 Answers1

1

There are no differences if we speak about HTML5. It makes sense to close the tag only if you work with XHTML, otherwise it's not necessary. You can close tag or not. Both are acceptable in HTML. Space before the slash makes nothing except better reading opportunity.

Sergey
  • 7,184
  • 13
  • 42
  • 85