Simple jQuery code snippet to get label text associated with checkbox.
console.log($('label[for="carHireChk"]').html()); $("label[for='comedyclubs']") $("label[for=' + this.attr("id") + ']").attr('class', 'error');
See doco for more info: http://api.jquery.com/next-adjacent-Selector/
Sam Deering has 15+ years of programming and website development experience. He was a website consultant at Console, ABC News, Flight Centre, Sapient Nitro, and the QLD Government and runs a tech blog with over 1 million views per month. Currently, Sam is the Founder of Crypto News, Australia.
Visual Studio Code: End-to-End Editing and Debugging Tools for Web Developers
Form Design Patterns
Jump Start Git, 2nd Edition