The audacity to do such a thing…

  • Pxtl@lemmy.ca
    link
    fedilink
    English
    arrow-up
    23
    ·
    1 year ago

    The reason I hate HTML: I’ve seen smart, reasonable people do this with IDs, and I’m not 100% sure they’re wrong.

    • jvisick@programming.dev
      link
      fedilink
      arrow-up
      33
      ·
      1 year ago

      That’s because it makes sense when dynamically creating HTML. HTML is not a programming language, it’s simply markup - so if you want to generate some block of HTML in a loop and later access that block of HTML in JS (e.g. to interact with the UI separate from creating it in the first place), it’s a completely reasonable thing to do.

      • Clent@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        1 year ago

        Agreed.

        Also, HTML is only meant to be read by a browser’s interpreter which has no problem keeping track of variable names.