The labels read-only property of the ElementInternals interface returns the labels associated with the element.
labels
MDN Reference