Features

A very simple tag-input plugin for jQuery. When your users are tagging,
This offers a simple but necessary and sufficient tool to them.

Demo

["United States", "United Kingdom", "Japan"]
["elefant"]
["panda","giraff","elefant","raccoon","dog","kangaroo","horse","rabbit","fox","hawk","bat","koala","lion","sheep","cat","tiger","zebra"]
 

Other demos

Also in these demos, This plugin are used. Also on codepen, you can see the demo above.

Browser Supported

MBP

  • Chrome
  • Firefox
  • Safari

Win10

  • Chrome
  • Firefox
  • Edge

iPad

  • Chrome
  • Firefox
  • Safari

Nexus 7

  • Chrome
  • Firefox
*1 On Firefox and Edge, scroll bar design is not under controll.

Minimal Setup


<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="./tagarea.js"></script>
<script type="text/javascript">
	$(function(){
		$('#country').tagarea({
			taglist_url: './country.php'
		});

		$('#animal').tagarea();
	});
</script>

<div id="country" class="tagareabox">
	<div class="pre-tag">["United States", "United Kingdom", "Japan"]</div>
</div>

<div id="animal" class="tagareabox">
	<div class="pre-tag">["elefant"]</div>
	<div class="pre-list">["panda","giraff","elefant", ... ,"zebra"]</div>
</div>
			

Main Options

OPTIONDEFAULTEXAMPLES
taglist_urlnull
  • "./taglist.php"
  • "//example.com/taglist.php"
onAddTagnull
function(tag_name){
	console.log('add', tag_name);
}
onRemoveTagnull
function(tag_name){
	console.log('remove', tag_name);
}
onChangeTagnull
function(tag_name){
	console.log('change', tag_name);
}

Main Methods

METHODEXAMPLES
execute() If this 'lion' tag is already selected, then the tag will be removed. If not, added.
var tagareaObj = $('#animal').tagarea();
tagareaObj.execute('lion');
inTagbox() If this 'lion' tag is already selected and in tagbox, return true.
var tagareaObj = $('#animal').tagarea();
tagareaObj.inTagbox('lion');
inTaglist() If this 'lion' tag is in the taglist of candidates, return true.
var tagareaObj = $('#animal').tagarea();
tagareaObj.inTaglist('lion');

Github

Isotake/opus_tagarea on Github

Contact

contact on twitter

Licence

This software is released under the MIT License, see the following URL.

Isotake/opus_tagarea/LICENCE.md on Github