CSS to target checkbox labels on forms
I know you can target the label individually, but is there a systematic method of targeting labels that appear next to checkboxes?
I know you can target the label individually, but is there a systematic method of targeting labels that appear next to checkboxes?
MktoForms2.whenReady(function(form){
var formEl = form.getFormElem()[0],
labels = formEl.querySelectorAll('label.mktoLabel');
[].slice.call(labels)
.forEach(function(label){
label.className += ' label-' + formEl.querySelector('#' + label.htmlFor).type;
});
});
This'll add an additional class to every <label> element that corresponds to its target element's type (class="label-checkbox", class="label-email", etc.).
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.