html - Get a contents of a label using jquery -


i want contents of label using jquery. example:

<input type="checkbox" id="checkbox1"> <label for="checkbox1">get text of label</label> 

thanks

like rory mccrossan points out, basic jquery. please note link provides: http://api.jquery.com/category/selectors/

$('[for=checkbox1]').text(); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -