Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Tagify">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Tagify</title>
  <meta name="author" content="Yair Even Or">
  <script src="https://unpkg.com/@yaireo/tagify"></script>
  <script src="https://unpkg.com/@yaireo/tagify@3.1.0/dist/tagify.polyfills.min.js"></script>
 <link href="https://unpkg.com/@yaireo/tagify/dist/tagify.css" rel="stylesheet" type="text/css" />
  <style>
    .tagify{ line-height:normal; }
  </style>
</head>
<body>
  
  <input value="xxx, yyy, zzz">
  
</body>
</html>
 
var input = document.querySelector('input')
var tagify = new Tagify(input,{
    keepInvalidTags: true,
    whitelist:['aaa', 'aaaaaa', 'aaaaaa', 'aaaaaaaa'],
    hooks: {
        /**
         * Removes a tag
         * @param  {Array}  tags [Array of Objects [{node:..., data:...}, {...}, ...]]
         */
        beforeRemoveTag : tags => {
            tags[0].node.classList.add('tagify__tag--loading')
            return new Promise((resolve, reject) => {
                confirm(`Remove ${tags[0].data.value} ?`)
                    ? resolve()
                    : reject()
            })
        }
    }
})
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
yairEOpro
0viewers