"Bootstrap Tags Input: A Simple jQuery Plugin for Tagging"

💡 jQuery Plugin Spotlight: Bootstrap Tags Input Need a simple, elegant way for users to add tags in your web forms? Let’s revisit a classic — Bootstrap Tags Input by Tim Schlechter. Although it hasn’t been updated for years, it’s still a clean and lightweight solution for jQuery + Bootstrap projects. ⚙️ How It Works Just include the JS/CSS files and add: <input type="text" data-role="tagsinput" /> ✅ That’s it — you now have a tag editor! 🔄 Key Features Events beforeItemAdd / itemAdded: Triggered before/after a tag is added beforeItemRemove / itemRemoved: Triggered before/after a tag is deleted Methods $('input').tagsinput('add', 'tag'); $('input').tagsinput('remove', 'tag'); $('input').tagsinput('removeAll'); $('input').tagsinput('focus'); $('input').tagsinput('destroy'); ⚙️ Options That Matter tagClass: Set custom CSS classes itemValue & itemText: Define value + label confirmKeys: e.g. [13, 44] for Enter + comma maxTags, maxChars: Limit tags or length typeahead: Suggest tags via autocomplete freeInput: Allow new tags not in list Example: $('input').tagsinput({ typeahead: { source: ['jQuery','PHP','Git'] }, freeInput: true, maxTags: 5 }); 💬 Why Use It? ✅ Simple & beautiful UI ✅ Lightweight, no heavy dependencies ✅ Perfect for quick tagging needs If your stack still uses jQuery + Bootstrap, this plugin is a timeless choice. For modern stacks, check out: 👉 Tagify, React Tags Input, or Vue Tags Input. ✍️ Written by Trương Tuấn Anh — sharing frontend tools that still shine years later. #WebDevelopment #jQuery #Bootstrap #Frontend #JavaScript #OpenSource

To view or add a comment, sign in

Explore content categories