diff --git a/src/jquery.tagsinput.js b/src/jquery.tagsinput.js index b6c75e4..ef01303 100644 --- a/src/jquery.tagsinput.js +++ b/src/jquery.tagsinput.js @@ -166,6 +166,11 @@ var tagslist = $(this).val().split(delimiter[id]); return (jQuery.inArray(val, tagslist) >= 0); //true when tag exists, false when not }; + + $.fn.getTags = function() { + var id = $(this).attr('id'); + return $(this).val().split(delimiter[id]); + }; // clear all existing tags and import new ones from a string $.fn.importTags = function(str) {