Trilium Backend API
    Preparing search index...
    • Adds class(es) to all of the matched elements. Also accepts a function.

      Type Parameters

      Parameters

      • this: R
      • Optionalvalue: string | ((this: Element, i: number, className: string) => string)

        Name of new class.

      Returns R

      The instance itself.

      $('.pear').addClass('fruit').prop('outerHTML');
      //=> <li class="pear fruit">Pear</li>

      $('.apple').addClass('fruit red').prop('outerHTML');
      //=> <li class="apple fruit red">Apple</li>