Trilium Backend API
    Preparing search index...
    • Remove elements from the set of matched elements. Given a Cheerio object that represents a set of DOM elements, the .not() method constructs a new Cheerio object from a subset of the matching elements. The supplied selector is tested against each element; the elements that don't match the selector will be included in the result.

      The .not() method can take a function as its argument in the same way that .filter() does. Elements for which the function returns true are excluded from the filtered set; all other elements are included.

      Type Parameters

      Parameters

      Returns Cheerio<T>

      The filtered collection.

      $('li').not('.apple').length;
      //=> 2
      $('li').not(function (i, el) {
      // this === el
      return $(this).attr('class') === 'orange';
      }).length; //=> 2