26 January 2004 2 comments Web development
This blog post is 18 years old! Most likely, its content is outdated. Especially if it's technical.
Simon Willison has written a nice article about Simple tricks for more usable forms and from it I learned about how <label>
tags work. They have been part of HTML since 1998 so today most browsers should support them; and if not, it's not a show-stopper. What they do is that they help to associate a text with an input field. For example, here, mouseclick the word "Name" and "Agree?" below.
Nothing happens! Instead, with <label>
tags, notice the difference when you mouseclick the words "Name" and "Agree?"
For code for the latter example is:
<form>
<label for="name2"><b>Name</b></label>
<input name="var21" id="name2"><br>
<label for="agree2">Agree?</label>
<input type="checkbox" name="var22" id="agree2">
</form>
- Previous:
- Robots.txt Validator 24 January 2004
- Next:
- Dabbrev in Jed 26 January 2004
- Related by category:
- Fastest way to find out if a file exists in S3 (with boto3) 16 June 2017 Web development
- How to throttle AND debounce an autocomplete input in React 1 March 2018 Web development
- How to create-react-app with Docker 17 November 2017 Web development
- Be very careful with your add_header in Nginx! You might make your site insecure 11 February 2018 Web development
- How to have default/initial values in a Django form that is bound and rendered 10 January 2020 Web development
- Related by keyword:
- How to have default/initial values in a Django form that is bound and rendered 10 January 2020
- Button tag in bloody Internet Explorer 9 August 2005
- Command-Enter to submit a form when focus is inside textarea with React (TypeScript) 4 February 2022
- Automatically strip whitespace in Django forms 12 October 2009
does not work
whats the point?