diff --git a/js/tag-it.js b/js/tag-it.js index 078c264f..8024a142 100644 --- a/js/tag-it.js +++ b/js/tag-it.js @@ -121,7 +121,11 @@ this.options.singleFieldNode = this.element; this.element.addClass('tagit-hidden-field'); } else { - this.tagList = this.element.find('ul, ol').andSelf().last(); + if ($.isFunction($.fn.addBack)) { + this.tagList = this.element.find('ul, ol').addBack().last(); + } else { + this.tagList = this.element.find('ul, ol').andSelf().last(); + } } this.tagInput = $('').addClass('ui-widget-content');