I\'m using the autocomplete function in jQuery UI 1.8.6. And I want to highlight matching results. But for some reason when I use a regex to add \"strong\" tags around the m
$.extend($.ui.autocomplete.prototype, {
_renderItem: function (ul, item) {
var searchMask = this.element.val();
var regEx = new RegExp(searchMask, "ig");
var replaceMask = "$&";
var html = item.label.replace(regEx, replaceMask);
return $("")
.data("item.autocomplete", item)
.append($("").html(html))
.appendTo(ul);
}
});