Skip to main Content
Back to posts

ARIA attributes

Posted 11mnths ago
profile pic

Johnte Back end 2 Comments

Can ARIA attributes be added dynamically with JavaScript?

0 up votes 0 down votes

Comments

  • profile pic
    mailtoloco

    Hello,

    To add aria attributes and other type of attributes, is the basement of javascript accessibility extensions (like the WebAccessibilizer that I am the author).

    Example:

    var elm = document.getElementById("input");

    // to attach an aria label to that element

    elm.setAttribute("aria-label", "Enter your name");

    // to deactivate the checking of grammatical error in that field

    elm.setAttribute("spellcheck", "false");

    0 up votes 0 Down votes
  • profile pic
    Master Frenkie

    My thinking is yeah they can be used. For example, the aria-required attribute is used dynamically with JavaScript for better functionality.

    0 up votes 0 Down votes

Unleash Your Voice, Amplify Accessibility

Empower Your Voice, Share Your Topics on Accessibility, and Ignite a Change in web content

Create a post