Try it out
Use comma , as the separator
BACKSPACE removes a tag if there are no characters to remove
Retrieve all tags
NPM INSTALL
HTML:
JavaScript:
ES6 MODULES
You need to include type="module" in the script element, to declare the script as a module. Read more
HTML:
JavaScript:
Styles
CSS:
Syntax
new Taggier(divId|div[, options]);
Parameters
divId String - The id of the div Element
div HTMLDivElement - The div Element
options Object - Optional
Options
Object: Second parameter - Optional
gap Number - Set the gap in pixels between each tag. Default: 16
forbiddenPattern Regex | Boolean - Forbidden characters. (Set to false to have none). Default: /[^\w]+/g
hashtag Boolean - Is hashtag. Default: false
border Boolean - If no css for the element is specified a 1px solid gray will be assign. Default: true
focus Boolean - Has outline. Default: true
Accessors
tags Array - Array of strings beeing each element a tag text.
Methods
getTags() : Array - Returns a new Array of strings beeing each element a tag text.
setTags(values) (values : Array) : void - Sets tags beeing each element a tag text.
addTags(values) (values : Array) : void - Add tags beeing each element a tag text.
removeAll() : void - Remove all tags.
hasPendingText() : Boolean - Returns true if there is any text not tagged.
pendingText() : String - Returns the pending text in the element.
makeTagFromPendingText() : void - Makes a Tag from pending text in the element.