I want to insert value through jquery to tags input element html. But didn't work.
My code JS :
$(document).ready(function(){
$('#tags-input').tagsInput();
var tagsValue = 'Jakarta,Bogor,Bandung';
$('#tags-input').val(tagsValue);
});
My code html :
<input type="text" class="form-control" name="city" id="tags-input" />
how can i do it? Please help me. Thank you
You need to use the
add
method of tagsinput.