replace supported elements with span tags in order to style them easier
supported input types checkbox, radio
-
replaceAll
true (default): replaces all supported elements within a jQuery obj
false: replaces all elements with the selector specified by 'selector' within a jQuery obj -
selector
.js-input-replace: default selector string, can be changed to any other string. used ifreplaceAllis set tofalse -
hasIcon
true (default): adds a class to use with icon font; format: icon-[input type]
false: does nothing -
complete
callback function
- 'data-icon-class'
set the data attribute to manually set a specific class name
.checkedfor active input element
.checkbox,.radioaccordant to the element type of the original input element
.icon-checkbox,.icon-radiosee 'hasIcon' above
basic:
jQuery.inputreplace();extended:
jQuery.inputreplace({
replaceAll: false,
selector: '.my-preferred-selector',
hasIcon: true,
complete: function() {
// stuff to run
}
});