Tag suggestion

Remote search

In the following example, the plugin will search remotely for suggestions. Please enter a list of email addresses.




Source code

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

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

<p><input type='button' onclick='alert(tags.getValue())' value='Get the values'></p>

<script>
var tags = jSuites.tags(document.getElementById('tags'), {
    value: [{ text:'Contact', value:'contact@jspreadsheet.com' }],
    search: '/v3/data?q=',
    placeholder: 'To'
});
</script>
</html>

Local search

In the following example, the plugin will search within the array given to it. Please, enter a list of fruit.


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

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

<p><input type='button' onclick='alert(tagsLocal.getValue())' value='Get the values'></p>

<script>
var tagsLocal = jSuites.tags(document.getElementById('tags-local'), {
    search: [
        "apple",
        "watermelon",
        "orange",
        "strawberry",
        "grape",
        "cherry",
        "mango",
        "nectarine",
        "banana",
        "pomegranate"
    ],
    placeholder: 'Fruits'
});
</script>
</html>