Function grabAttr

  • Grabs an attribute value from the given HTML string or node array based on the selector.

    Parameters

    • from: string | Node[]

      The HTML string or node array to search in.

    • sel: Selector

      The selector defining the node.

    • attr: string

      The attribute key whose value is to be returned.

    Returns AttrValue

    The value of the attribute or an empty string if not found.