Example file Using Explicit label

The below is the static form with html code snippet that is used for this example. The reason for providing the code snippet is that one can access the source code easily even if it is viewed in the mobile platforms. In general, it might not be very easy to access the source code of the form when this is viewed in the mobile platforms. This example makes you understand how the labels are associated with the “for and ID” technique when you run the screen reader on this form across all the platforms.






Select Gender






Source Code

</p><h1> Using Explicit Label</h1><p><label for="fname"> First Name </label><br /> <input type="text" id="fname"/><br /> <label for="lname"> last Name </label><br /> <input type="text" id="lname"/><br /> <label for="age"> Age </label><br /> <select id="age"><option value="10">10</option><option value="20">20</option><option value="30">30</option><option value="40">40</option></select></p><fieldset><legend> Select Gender</legend><p><input type="radio" name="sex" id="mm" checked> <label for="mm"> Male </label><br /> <input type="radio" name="sex" id="nn"> <label for="nn"> Female </label><br /></fieldset><p><label for="comn"> Comments: </label><br /><textarea rows="5" cols="50" id="comn"></textarea><br /> <input type="checkbox" name="terms" id="pp"> <label for="pp"> I agree terms and conditions </label><br /> <input type="submit"/> <input type="button" value="reset"><br /></form><p>

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.