jQuery Plugin For Easy Tags Input with Auto Suggestion - tagsly

jQuery Plugin For Easy Tags Input with Auto Suggestion - tagsly
File Size: 4.52 KB
Views Total: 3941
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A jQuery plugin to turn a text field into a tagging system which allows the visitor to quickly add/remove tags with auto suggestion support. The plugin allows to split tags when comma or space is pressed and to remove the previous tag when backspace is pressed.

How to use it:

1. Include jQuery JavaScript library and the jQuery tagsly plugin's JS & stylesheet in the web page.

<link rel="stylesheet" href="tagsly.css">

<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="tagsly.js"></script>

2. Create a standard text input on the web page.

<input id="tags" name="tags" type="text" value="">

3. Call the plugin with options and define an array of preset tags for autosuggestion.

$(function() {
  $('#tags').tagsly({
    suggestions: function(input, cb) {
      cb(['jQuery', 'Html', 'CSS', 'JavaScript']);
    },
    placeholder: 'Enter tags!',
    maxItems: 5
  });
});

This awesome jQuery plugin is developed by mfiels. For more Advanced Usages, please check the demo page or visit the official website.