@laserware/dominator
    Preparing search index...

    Function selectDatasetEntry

    • Attempts to build a valid selector for a dataset with the specified key and optional value. If tagName is specified, it is included in the resulting selector.

      Parameters

      • key: string

        Property or attribute name for the dataset entry.

      • Optionalvalue: null | DatasetValue

        Optional value of the dataset entry.

      • OptionaltagName: string

        Optional tag name for the element.

      Returns string

      CSS selector based on the specified key and optional value.

      Dataset Key without Value

      selectDatasetEntry("someThing");
      // `[data-some-thing]`

      data- Attribute Name without Value

      selectDatasetEntry("data-some-thing");
      // `[data-some-thing]`

      Dataset Key with Value

      selectDatasetEntry("someThing", "stuff");
      // `[data-some-thing="stuff"]`

      data- Attribute Name with Value and Tag

      selectDatasetEntry("data-some-thing", "stuff", "a");
      // `a[data-some-thing="stuff"]`