• dukk
    link
    fedilink
    arrow-up
    1
    ·
    4 months ago

    Trailing slash lets you do this though:

    For example, in the case of <div/>Some text, browsers interpret this as <div>Some text</div>, treating the slash as ignored and considering the div element to encapsulate the text that follows.

    • KairuByte@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      5
      ·
      4 months ago

      This is terrible.

      You should never rely on a browser interpreting a non standard use in a specific way. It can change at any moment, and wouldn’t be reliably reversed because it’s inherently non standard.