Skip to content

Instantly share code, notes, and snippets.

@robsonsobral
Created April 30, 2022 02:57
Show Gist options
  • Save robsonsobral/aeec69d52f9240fc3408ec6c7f7ea671 to your computer and use it in GitHub Desktop.
Save robsonsobral/aeec69d52f9240fc3408ec6c7f7ea671 to your computer and use it in GitHub Desktop.
function getLabelTextFromField(formElement) {
return formElement.ariaLabel
|| formElement.labels?.[0]?.textContent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment