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.

Revisions

  1. robsonsobral created this gist Apr 30, 2022.
    4 changes: 4 additions & 0 deletions getLabelTextFromField.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    function getLabelTextFromField(formElement) {
    return formElement.ariaLabel
    || formElement.labels?.[0]?.textContent;
    }