Base Bootstrap-Tagsinput

by 20yco

HTML

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/dist/bootstrap-tagsinput.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
<link rel="stylesheet" href="https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/assets/app.css">
<input type="text" ID="txtSearch" data-role="tagsinput" />

<input type="text" ID="txtSearchs" data-role="tagsinput" />


<div class="items"></div>

CSS

.items span {
    display: inline-block;
    margin: 5px;
    padding: 5px;
    border: 1px solid #CCC;
}

JavaScript

$("[id$=txtSearch]").tagsinput('items');
$("[id$=txtSearchs]").tagsinput('items');

$(document).on('keyup', ".bootstrap-tagsinput", function(e) {
    alert('hello');
});