Replace command
Replace existing content with new content, based on simple strings or regexes.
Basic Usage (HTML)
data-jkit="[replace:search=[0-9]+;replacement=XXX]"
Advanced Init (JavaScript)
$('#myelement').jKit('replace', { 'search': '[0-9]+', 'replacement': 'XXX' });
Options
Option | Values | Default | Description |
---|---|---|---|
modifier | String | g | The regular expression modifier to use |
search | String | The string or regular expression to search | |
replacement | String | The replacement string |
Events
Examples
Name replace:
Replace the name “Fredi” with “Fredi Bach” in bold:
Number hide:
Replace all numbers with XXX using a regular expression:
Source:
<div data-jkit="[replace:search=[0-9]+;replacement=XXX]"> This product costs 123 dollars more than the other product that costs just 77 dollars. </div>
Replacements
There are currently no replacements for this command.
[ Learn more about replacements ]
Discussions
Do you have questions or do you want to suggest new features? Than head over to our new community:
[ jKit Community ]