Back to the plugin

Quick reference

Considering the following example:

<html>
<script src="https://bossanova.uk/jsuites/v3/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jsuites/v3/jsuites.css" type="text/css" />

<div id="tags"></div>

<script>
var myTagInstance = jSuites.tags(document.getElementById('tags'), {
    onchange: function() {
        console.log(arguments);
    }
});
</script>
</html>


Available Methods

Method Description
myTagInstance.getData();Get all tags as a object
myTagInstance.getValue(number)Get a specific tag by index or all tags value
@param integer indexNumber - Null for all tags
myTagInstance.setValue(string);Set a new value for the javascript tagging
@param string newValue - Values separate by comma
myTagInstance.reset();Clear all tags
myTagInstance.isValid();Validate tags


Initialiation properties

Property Description
value: stringInitial value of the compontent
limit: numberMax number of tags inside the element
search: stringThe URL for the remote suggestions
placeholder: stringThe default instruction text on the element
validation: functionMethod to validate the entries in the input.
(element: HTMLElement, value: any, id: any) => boolean


Available events

Method Description
onbeforechangeMethod executed before a value is changed.
(element: HTMLElement, instance: JSON, value: string) => string
onchangeMethod executed when a value is changed.
(element: HTMLElement, instance: JSON, value: string) => void
onfocusMethod executed when the input is focused.
(element: HTMLElement, instance: JSON, currentValue: string) => void
onblurMethod executed when the input is focused.
(element: HTMLElement, instance: JSON, currentValue: string) => void
onloadMethod executed the DOM element is ready.
(element: HTMLElement, instance: JSON) => void