Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🔖 <input type="tags"> like magic

License

NotificationsYou must be signed in to change notification settings

developit/tags-input

Repository files navigation

NPM VersionBower VersionGitter Room

Features:

  • I said<input type="tags"> should be a thing.
  • With full keyboard, mouse and focus support.
  • Works with HTML5pattern andplaceholder attributes, too!
  • Nativechange andinput("live" change) events.
  • Usingpreact? (or react?) There's a wrapper calledpreact-token-input
  • Works in modern browsers and IE10+

Screenshot:

screenshot

JSFiddle Demo


Examples

It's easy to use! In addition to the example code, you'll also need toincludetags-input.css - I didn't bundle it because that's a bit gross.

CommonJS:

vartagsInput=require('tags-input');// create a new tag input:vartags=document.createElement('input');tags.setAttribute('type','tags');tagsInput(tags);document.body.appendChild(tags);// enhance an existing input:tagsInput(document.querySelector('input[type="tags"]'));// or just enhance all tag inputs on the page:[].forEach.call(document.querySelectorAll('input[type="tags"]'),tagsInput);

HTML Example:

<linkrel="stylesheet"href="tags-input.css"><scriptsrc="tags-input.js"></script><form><label>Add some<inputname="hashtags"type="tags"pattern="^#"placeholder="#hashtags"></label></form><script>[].forEach.call(document.querySelectorAll('input[type="tags"]'),tagsInput);</script>

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp