I try to do something after a tag was added into input box, I know there are event in Tags Input Bootstrap called itemAdded. But I don't why, but my code is not working.
HTML:
`<input id = "zipcode" method ="post" type="text" class = "m-wrap tags" />`
JS:
<script type="text/javascript">
$(document).ready(function() {
$('.tags').tagsInput({
'width': 'auto',
'defaultText': 'e.g. 48108'
});
});
$('#zipcode').on('itemAdded', function(event) {
// do something with event.item at here. example:
alert(event.item);
});
</script>
Don't know why this is not working. When I input new tag, nothing happen.
Thank you.