Beautiful Draggable Tag Box Plugin with jQuery | Tag Me

Tag Me is a simple jQuery script to turn a plain text area into a beautiful animated tag input box that allows you to:

  • Press Enter to add tags.
  • Double click to edit the tag.
  • Click on x or Double Backspace or remove all text and hit Enter to delete a tag.
  • Sort tags using jQuery UI draggable.

jquery tag library, selectize jquery plugin example, javascript tag input, tags field, multiple tags in input field, tag it jquery

Nice Simple Tag Input With Minimal Design For Bootstrap | MAB.Bootstrap.TagInput

How to make use of it:

1. Load the necessary jQuery library, JavaScript, and CSS for jQuery UI into the document.

<link rel="stylesheet" href="//">
<script src="//"></script>
<script src="//"></script>

2. Create a text area containing a list of predefined tags separated by a space.

<textarea class="tagarea">
  Codepen Twitter Facebook Vini TagMe webcodeflow

3. Basic CSS for designing the tag input box.

.tagarea { display: none; }

.tag-box {
  list-style: none;
  padding: 3px;
  margin: 0;
  display: inline-block;
  font-family: arial;
  width: 100%;
  border: 1px solid #F44336;
  border-radius: 4px;

.tag-box * {
  -webkit-transition-property: all;
  transition-property: all;
  -webkit-transition-duration: 0.3s;
  transition-duration: 0.3s;

.tag-box li {
  padding: 4px 6px;
  float: left;
  display: inline-block;

.tag-box li.tags {
  background: #2196F3;
  color: #fff;
  border-radius: 4px;
  margin: 4px 3px;
  position: relative;

.tag-box li.tags .close {
  display: inline-block;
  position: absolute;
  color: #BBDEFB;
  overflow: hidden;
  width: 0;
  right: 0;
  height: 18px;
  cursor: pointer;
  top: 4px;

.tag-box li.tags .close:after { content: 'x'; }

.tag-box li.tags.edit {
  background: none;
  border: 1px solid #2196F3;
  color: #2196F3;

.tag-box li.tags.edit .input-tag { height: auto; }

.tag-box li.tags.edit:hover { padding: 4px 6px; }

.tag-box li.tags.danger {
  background: #F00;
  opacity: 0.8;

.tag-box li.tags:hover { padding-right: 18px; }

.tag-box li.tags:hover .close { width: 14px; }

.tag-box li .input-tag {
  color: #fff;
  height: 24px;
  vertical-align: middle;
  border: none;
  outline: none;
  background: none;

.tag-box li .input-tag:hover,
.tag-box li .input-tag:focus {
  outline: none;
  border: none;

4. JavaScript (jQuery) Activates the draggable tag input box.

var backSpace;
var close = '<a class="close"></a>'; 
var PreTags = $('.tagarea').val().trim().split(" ");

$('.tagarea').after('<ul class="tag-box"></ul>');

for (i=0 ; i < PreTags.length; i++ ){
  $('.tag-box').append('<li class="tags">'+PreTags[i]+close+'</li>');

$('.tag-box').append('<li class="new-tag"><input class="input-tag" type="text"></li>');

// Taging 
$('.input-tag').bind("keydown", function (kp) {
  var tag = $('.input-tag').val().trim();
    if(tag.length > 0){
      backSpace = 0;
      if(kp.keyCode  == 13){
        $(".new-tag").before('<li class="tags">'+tag+close+'</li>');
    else {if(kp.keyCode == 8 ){
     if(backSpace == 2 ){
       backSpace = 0;

//Delete tag
$(".tag-box").on("click", ".close", function()  {


// Edit
$('.tag-box').on("dblclick" , ".tags", function(cl){
  var tags = $(this); 
  var tag = tags.text().trim();
  tags.html('<input class="input-tag" value="'+tag+'" type="text">')
  tag = $(this).find('.input-tag').val() ;
    tags.html(tag + close);
  tags.find('.input-tag').bind("keydown", function (edit) {
    tag = $(this).val() ;
    if(edit.keyCode  == 13){
      if(tag.length > 0){
        tags.html(tag + close);

// sorting
$(function() {
$( ".tag-box" ).sortable({
items: "li:not(.new-tag)",
  containment: "parent",
  scrollSpeed: 100

$( ".tag-box" ).disableSelection();


Pretty Draggable Tag Box, Tag Me Plugin/Github

See Demo And Download

Official Website(vineethtrv): Click Here

This superior jQuery/javascript plugin is developed by vineethtrv. For extra advanced usage, please go to the official website.

Related Posts


Responsive Drag and Drop File Uploader/Download Plugin | 5x5_jq_uploader

5x5_jq_uploader plugin can be used to instantly create a drop file area and file queue with a little bit of preparation. Bootstrap is used for responsive planning…


Stylesheet For Implementing Dark Mode with Bootstrap

Bootstrap Dark Mode provides a style sheet and two texts that allow you to implement Dark Mode on your website. Initially loaded based on user preferences, can…


Multi-purpose Navigation Menu for Javascript Library | jQuery Corenav

coreNavigation is a multipurpose navigation menu for a jquery based javascript library, comes with more style, and is easy to integrate. 11 Default Menu 2 Responsive Navigation…


Simple Multi-Select Dropdown Pure Vanilla Javascript | multiSelect.js

MultiSelect.js is a simple, clean, and progressive JavaScript library designed for easy integration with any type of project or system. The design was heavily influenced by the…


Confetti Falling Animation Effect In JavaScript | party.js

Party.js is a JavaScript library to brighten user site experience with visual effects! Celebrate success with dom confetti! The library is written in TypeScript and compiled into…


How To Create A Popup in HTML with CSS

How to create popup in html with css – Popup without JavaScript is an elegant pop-up panel component with an animated scale, written in CSS. Have you…