4 ms·
I like this! It's fun to compare it to "A blog post with every HTML element" [1][2], which gets at a (very!) similar thing but in a very different way. This po
by eieio 2y ago
I like this!
It's fun to compare it to "A blog post with every HTML element" [1][2], which gets at a (very!) similar thing but in a very different way. This post primary shows, and is a little more chaotic (meant positively!) whereas the other post is much more prose and explanation heavy (also good, but very different).
[1] https://www.patrickweaver.net/blog/a-blog-post-with-every-html-element/ https://www.patrickweaver.net/blog/a-blog-post-with-every-ht...
[2] HN discussion: https://news.ycombinator.com/item?id=37104742 https://news.ycombinator.com/item?id=37104742
- wxw 2y agoWhoa! I'm a big fan of yours. You've really inspired me to think more creatively about the web/software. Thanks a ton, I'm glad this reached you.
- eieio 2y agoAh well hello! I'm not sure I've been recognized like that on the internet before. Thank you, that makes me very happy! From your website it looks like we're in the same city; feel free to shoot me an email (mine is in my profile) if you'd like to grab coffee sometime :)
- lelanthran 2y agoAfter looking at the source for this, I have a tangential question (feel free to answer even if you aren't the OP): Whats the advantage of creating a separate `label` element before/after the input and using `for=` compared to simply wrapping the target input in the label element, like the code snippet below? <label> Your Name? <input /> </label> It seems to me that there is a lot less room for error when not using IDs, so I always wrap the input. My pages use a client-side webcomponent to inject fragments of HTML into the page (navbar, footer, etc), and using IDs almost always cause conflicts in the end, so I avoid ID attributes in all but a few very rare instances.
- assimpleaspossi 2y agoNote that the <input> tag does not need and does not use a closing slash and never has in any HTML standard: https://html.spec.whatwg.org/dev/input.html#the-input-element https://html.spec.whatwg.org/dev/input.html#the-input-elemen...
- hk1337 2y agoIt was required in the XHTML 1.0 specs, people carried it over I don’t know why but everyone stopped validating html so nobody cared.
- lelanthran 2y agoSure, but ... what about the question I posed?
- kevindamm 2y agoUpside (of implicit labels) is that there's no more gap and you can avoid the exclusivity of `id` attributes (as you mention). Downside is that screen readers may not handle the implicit label as well as one with explicit for= on it. https://www.w3.org/WAI/tutorials/forms/labels/ https://www.w3.org/WAI/tutorials/forms/labels/