Bootstrap tags input example

Hello Guys,

In the blog applications, while creating blog, you want to add multiple tags for the article. Dropdown only allows users to select options list. You may want user to input desired tags. This is where Bootstrap tags input plugin is useful.

In this article, we will learn how to create and use Bootstrap tags input. Bootstrap tags input is a jQuery plugin providing a Twitter Bootstrap user interface for managing tags.


Download plugin zip code from GitHub. Alternativally you can use CDN file. First include Bootstrap 3.3.5 CDN files into <head> tag. Then include Bootstrap tags input css and Javascript tags.


Place all css in the <head> tag and script tags before </body> tag ends. In the <input> tag, add data-role="tagsinput" attribute to automatically change it to a tags input field. You can also use <select multiple> instead of <input> to get multivalue support. The value will be set in an array instead of comma seperated string.

Here is the example code:

<!DOCTYPE html>
        <title>Bootstrap Tags Input</title>
        <link rel="stylesheet" href="">
        <link rel="stylesheet" href=""/>
        <style type="text/css">
            .bootstrap-tagsinput {
                width: 100%;
        <div class="container">
            <h2>Bootstrap Tags Input</h2>
            <input type="text" value="Amsterdam,Washington,Sydney,Beijing,Cairo" data-role="tagsinput" />
        <script src=""></script>
        <script src=""></script>
        <script src=""></script>

To add the tag, press TAB button.

The Bootstrap tags input can be also used with Typeahead.js to predict the value from the predefined.

The plugin provides many options to customize tags input. It also supports required methods and events to perform task on event.

You can visit official documentation website to view full documentation.

I hope you will like to use the plugin in development.