I would like to know if a input type="checkbox" that comes just before a label is checked or not using javascript. The only thing I know is that the label has "Service Provider" in it
<input id="ctl00_ContentPlaceHolder1_UserTypeList_2" type="checkbox" name="ctl00$ContentPlaceHolder1$UserTypeList$2" />
<label for="ctl00_ContentPlaceHolder1_UserTypeList_2">Service Provider</label>
Tried this and failed.
$('label[text="Service Provider"]').prev().is(':checked')
What could I do?
Disclaimer: Its the markup rendered by ASP.NET 2.0 WebForms for a CheckBoxList