问题
Whilst searching for a away to add a tag to the jquery tagit, I came accross the following snippet:
$('.tagfilter').click(function(){
$('#addtags').tagit('add', 'test value');
return false;
});
However, this testing came accross this error:
Error: no such method 'add' for tagit widget instance
This snippet worked for someone else, but not me... any ideas?
回答1:
Try using :
$("#myTags").tagit("createTag", "brand-new-tag");
Source : https://github.com/aehlke/tag-it/blob/master/README.markdown
来源:https://stackoverflow.com/questions/25233444/jquery-tagit-no-such-method-add