diff --git a/README.md b/README.md index b80b046..da829e7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ The above would work with this HTML:
  • Two
  • Three
  • +**Note**: in case there is a rich content inside li items, attribute **data-text** can be set for each item and it's used for filtering as the most priority. Options ------- diff --git a/jquery.fastLiveFilter.js b/jquery.fastLiveFilter.js index bd53494..091804d 100644 --- a/jquery.fastLiveFilter.js +++ b/jquery.fastLiveFilter.js @@ -33,7 +33,7 @@ jQuery.fn.fastLiveFilter = function(list, options) { for (var i = 0; i < len; i++) { li = lis[i]; innerText = !options.selector ? - (li.textContent || li.innerText || "") : + (li.dataset.text || li.textContent || li.innerText || "") : $(li).find(options.selector).text(); if (innerText.toLowerCase().indexOf(filter) >= 0) {