Skip to content

bitlabstudio/jquery-typeahead-tagging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jQuery Typeahead Tagging

A jQuery plugin to turn a regular input into a tag input with typeahead autocompletion.

Check the example at the project page.

Usage

You need a regular text input.

<input type="text" id="taginput" value="">

And then you initialize the script.

// The source of the tags for autocompletion
var tagsource = ['Foo', 'Bar', 'Anoter Tag', 'Even more tags',
                 'Such autocomplete', 'Many tags', 'Wow'];

// Turn the input into the tagging input
$('#taginput').tagging(tagsource);

There you go. All done.

If you want to limit the maximum amount of tags, that can be added, specify the maximum amount as data attribute.

<!-- this input will only take 3 tags -->
<input type="text" data-max-tags="3" id="taginput" value="">

The value of the input will be all tags separated by comma. E.g. Foo,Bar.

About

A jQuery plugin to turn a regular input into a tag input with typeahead autocompletion.

Resources

Stars

Watchers

Forks

Packages

No packages published