logoalt Hacker News

HTML Lists

271 pointsby speckxtoday at 4:58 PM61 commentsview on HN

Comments

appplicationtoday at 5:23 PM

This was a fun little read. Just through testing the examples, I also learned datalist does not seem to work well on mobile safari (which is a large enough market I might even say there’s essentially no scenario in which it’s worth using if there’s a compatibility issue).

show 5 replies
VladVladikofftoday at 5:33 PM

>What if there’s a bunch of options, but for [reasons] we don’t want a user to be able to select a subset of them? Let’s add the disabled attribute to an optgroup

Seems broken in mobile safari, not actually disabled I can still select the disabled items.

show 1 reply
dzongatoday at 6:36 PM

this was a dope & comprehensive.

unfortunately we have a new class of dev's that never learned html but went straight for React. Now with LLMs they will never learn HTML.

hence they reach for react components where simple html would have been sufficient.

show 2 replies
montrosertoday at 5:34 PM

Good stuff, except don't get too excited about `datalist`. It just doesn't have enough hooks to be actually useful for anything other than a little prototype.

show 2 replies
nektrotoday at 7:19 PM

TIL <menu>, I wonder why more frameworks don't make use of it.

show 2 replies
jdw64today at 5:52 PM

HTML linters actually help distinguish things like that? I'm curious if there are any linters out there that can enforce this kind of semantic tag selection.

show 1 reply
kevinh456today at 10:13 PM

DL is a definition list not a description list.

show 2 replies
jimmaswelltoday at 5:22 PM

Lots of useful information I wasn't aware of after being a front-end lead for years. I'll start using these at work for sure.

tuzemectoday at 9:24 PM

Only if we had designers who like the default datalist appearance...

reconnectingtoday at 5:30 PM

This is how real HTML magic should look like:

<MARQUEE>

  <OL>
      <LI>One</LI>
      <LI>Two</LI>
      <LI>Three</LI>
  </OL>
</MARQUEE>
show 1 reply
WAtoday at 6:18 PM

And yet, no native select + search combined, which is a very common kind of list. The datalist is basically unusable, because you don't know any of the options.

ksectoday at 7:34 PM

Sigh. Just when I was cheering Safari, finally both on Desktop and on Mobile have gotten to the point of good enough.

And then to find out the list don't work on Safari iOS.

aletoday at 9:15 PM

Now i need one that explains the css counters

zombottoday at 5:24 PM

What I always wanted to know about lists and never dared to ask!

einpoklumtoday at 6:38 PM

tl;dr: You _do_ know HTML lists, they're basicaly like they used to be 20 years ago. But there are HTML form controls which are list-like and this will tell you about them: <select> and <datalist> which have <option> elements and <menu> which has <li> elements.

It's a nice read, not very long and you can kind of leisurely skim it.

MagicMoonlighttoday at 5:39 PM

That’s a really good article. It’s nice to see something which isn’t slop.

show 1 reply
asveikautoday at 5:56 PM

Title reminds me of Joni Mitchell.

    I've looked at lists from both sides now
    From give and take and still somehow
    It's HTML lists' illusions I recall 
    I really don't know HTML lists at all
show 1 reply
ShivamNayak11today at 8:56 PM

[dead]