Trilium Backend API
    Preparing search index...
    • Filters the set of matched elements to only those which have the given DOM element as a descendant or which have a descendant that matches the given selector. Equivalent to .filter(':has(selector)').

      Parameters

      Returns Cheerio<AnyNode>

      The filtered collection.

      $('ul').has('.pear').attr('id');
      //=> fruits
      $('ul').has($('.pear')[0]).attr('id');
      //=> fruits