Skip to content

replace supported elements with span tags in order to style them easier

Notifications You must be signed in to change notification settings

scheinercc/jquery.inputreplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

jquery.inputreplace

replace supported elements with span tags in order to style them easier

supported input types checkbox, radio

options

  • 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 if replaceAll is set to false

  • hasIcon
    true (default): adds a class to use with icon font; format: icon-[input type]
    false: does nothing

  • complete
    callback function

data options

  • 'data-icon-class'
    set the data attribute to manually set a specific class name

sets following class names

  • .checked for active input element
    .checkbox, .radio accordant to the element type of the original input element
    .icon-checkbox, .icon-radio see 'hasIcon' above

usage

basic:

	jQuery.inputreplace();

extended:

	jQuery.inputreplace({
		replaceAll: false,
		selector: '.my-preferred-selector',
		hasIcon: true,
		complete: function() {
			// stuff to run
		}
	});

About

replace supported elements with span tags in order to style them easier

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published