diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 91afcab5..65b69a90 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -151,7 +151,7 @@ }; function _formatGroup(suggestion, category) { - return '
' + category + '
'; + return $('
').append(category).prop('outerHTML'); }; Autocomplete.prototype = { @@ -665,7 +665,7 @@ html += formatGroup(suggestion, value, i); } - html += '
' + formatResult(suggestion, value, i) + '
'; + html += $('
').attr('data-index', i).addClass(className).append(formatResult(suggestion, value, i)).prop('outerHTML'); }); this.adjustContainerWidth();