Summary for the busy
- Allows elements to become "tags" and "taggable"
- Easily customizable actions on tag / untag
- Download here (plugin only)
- Download here (with examples)
- Fork it here
I've really enjoyed using jQuery over the last few years. It's been quite wonderful really. Outside of the core being easy to use and very solid, the plugins available really make jQuery sizzle.
So I thought I'd take a crack at writing my very own plugin. My main goal was to imitate the tagging interface you've seen in some desktop UIs, with Evernote being my main inspiration.
A few things I learned while writing the plugin:
- Writing a jQuery plugin is not that hard
- Developing jQuery plugins is really really fun (no really, it is)
The plugin requires jQuery and jQuery UI. Once you have the jQuery requirements and the plugin file, using the plugin is simple. Just call
.taggable() on the element that you want to have tags attached to. There are various ways to customize it beyond this of course. For those details, check out the README.
Other Tag-ish Plugins Out There
I fought the urge to look at existing work, mainly so that I could learn as much from tripping over my own two feet as possible. Upon writing this post, I decided 'why not' and Googled around for "jquery plugins tag" and other permutations. I was thrilled to see that it doesn't look like there are any other plugins that do quite this. All of the other options turn input into tags or create tag clouds.