goldies
    Preparing search index...

    Function $

    • Get the first element in the document matching selector. Shorthand for querySelector.

      Type Parameters

      • T extends Element = Element

      Parameters

      • selector: string

        DOM selector

      • context: Element | Document = document

        Optional context element for DOM query

      Returns T

      The first element matching the selector, or null if no match

      const $elA = $('.foo')
      const $elB = $('#bar')
      const $elC = $('section')