Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
function materializeCheckboxes() {
var parentEl;
document.querySelectorAll('input[type="checkbox"]').forEach(function(control) {
parentEl = control.parentElement;
control.classList.add('mdl-checkbox__input');
if (parentEl.tagName == "LABEL") {
parentEl.setAttribute('for', control.id || control.name)
parentEl.classList.add('mdl-checkbox', 'mdl-js-checkbox', 'mdl-js-ripple-effect');
}
});
}
function materializeControls() {
materializeTextInputs();
materializeSelects();
materializeRadioButtons();
materializeCheckboxes();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment