//Instantiate Taggle Object
const taggle = new Taggle('example1',{
onTagAdd: function(event, tag) {
let val = $('#val').val(tag);
// getTagValues() give total tags in comma seperated array
$('#val').val(taggle.getTagValues().join(','));
},
onTagRemove: function(event, tag) {
let val = $('#val').val(tag);
// getTagValues() give total tags in comma seperated array
$('.val').val(taggle.getTagValues().join(','));
},
// enables taggle js to save tags on blur
saveOnBlur:true,
placeholder:false
});
<div class="col-md-6">
<label>Enter Your Tags</label>
<div id="example1"></div>
<label>Get Values in Input Feilod</label>
<input type="text" id="val" class="form-control">
</div>