From a43fe97cd4a21487cbaf98bbdc97ac722a020c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Pokorn=C3=BD?= Date: Sun, 10 Jan 2016 18:35:52 +0100 Subject: [PATCH] Add method for returning list of tags --- src/jquery.tagsinput.js | 5 +++++ 1 file changed, 5 insertions(+) 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) {