{"id":2665,"date":"2015-05-27T08:26:40","date_gmt":"2015-05-27T04:26:40","guid":{"rendered":"http:\/\/nayarweb.com\/blog\/?p=2665"},"modified":"2017-04-16T21:57:42","modified_gmt":"2017-04-16T17:57:42","slug":"html5-labels","status":"publish","type":"post","link":"https:\/\/nayarweb.com\/blog\/2015\/html5-labels\/","title":{"rendered":"HTML5: Labels"},"content":{"rendered":"<p>W3School has this code snippet for doing Checkboxes<\/p>\n<p><textarea readonly style=\"width: 100%;\" rows=\"5\"><input type=\"checkbox\" name=\"vehicle\" value=\"Bike\">I have a bike<br \/>\n<input type=\"checkbox\" name=\"vehicle\" value=\"Car\">I have a car<\/textarea><\/p>\n<p>The result is like this<br \/>\n<input type=\"checkbox\" name=\"vehicle\" value=\"Bike\">I have a bike<br \/>\n<input type=\"checkbox\" name=\"vehicle\" value=\"Car\">I have a car <\/p>\n<p>Problem is, people have to specifically click on the checkbox. Lazy people like me would like little cursor movement as possible. Use of <em>labels<\/em>[<a href=\"http:\/\/stackoverflow.com\/questions\/6293588\/how-to-create-an-html-checkbox-with-a-clickable-label\" target=\"_blank\">1<\/a>] is important.<\/p>\n<p><textarea readonly style=\"width: 100%;\" rows=\"5\"><label><input type=\"checkbox\" name=\"vehicle\" value=\"Bike\" id=\"bike\">I have a bike<\/label><br \/>\n<label><input type=\"checkbox\" name=\"vehicle\" value=\"Car\">I have a car<\/label><\/textarea><\/p>\n<p>Now that I added label tags, click on the label and the checkbox gets activated. Same applies for Radio buttons <\/p>\n<form><label><input type=\"checkbox\" name=\"vehicle\" value=\"Bike\">I have a bike<\/label><br \/>\n<label><input type=\"checkbox\" name=\"vehicle\" value=\"Car\">I have a car<\/label><\/form>\n","protected":false},"excerpt":{"rendered":"<p>W3School has this code snippet for doing Checkboxes I have a bike I have a car The result is like this I have a bike I have a car Problem is, people have to specifically click on the checkbox. Lazy people like me would like little cursor movement as possible. Use of labels[1] is important. &hellip; <a href=\"https:\/\/nayarweb.com\/blog\/2015\/html5-labels\/\" class=\"continue-reading\">Continue reading <span class=\"screen-reader-text\">HTML5: Labels<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[210],"tags":[176],"class_list":["post-2665","post","type-post","status-publish","format-standard","hentry","category-technology","tag-html5"],"_links":{"self":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/2665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/comments?post=2665"}],"version-history":[{"count":17,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/2665\/revisions"}],"predecessor-version":[{"id":2721,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/2665\/revisions\/2721"}],"wp:attachment":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=2665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=2665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=2665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}