Ah 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 :)
After 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.
eieio|1 year ago
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|1 year ago
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?
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.kevindamm|1 year ago
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/
assimpleaspossi|1 year ago