Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6229097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:30:22+00:00 2026-05-24T09:30:22+00:00

Do ARIA properties need to exist within the actual HTML? Or, can they be

  • 0

Do ARIA properties need to exist within the actual HTML? Or, can they be added via Javascript at runtime?

Consider the following scenario…

<button id="submit" type="submit">Submit</button>
<div id="validation-message"></div>

If the user’s browser has no Javascript, we show them validation on a new page (processed and generated by server). If the user’s browser does have Javascript, we augment the above HTML with the following, and then show the validation dynamically in the DIV.

$('#submit').attr({'aria-haspopup':true, 'aria-owns':'validation-message'});
$('validation-message').attr({'role':'alert', 'aria-live':'assertive'});

I guess another questions is, does it hurt anything to have these ARIA properties directly within the HTML source? If Javascript is not present, would ARIA do anything at all?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:30:24+00:00Added an answer on May 24, 2026 at 9:30 am

    ARIA Landmark roles are OK to put directly in the markup, they can be beneficial even when JavaScript is disabled. If the functionality the ARIA attributes are describing is only available when JavaScript is enabled, I would say it’s OK to add those attributes with JavaScript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following HTML is inserted by the jQuery Grid plugin: <td role=gridcell style= aria-describedby=list_createdBy>Sam</td>
I have the following HTML: <button name=btnG class=gbqfb aria-label=Google Search id=gbqfb><span class=gbqfi></span></button> My following
On ARIA demonstration websites, role=contentinfo is usually added on footer element. However, footers in
There are some ARIA tutorial websites use non-semantic markup and some javascript to demostrate
I have the following markup: <input id=displayBuffer type=hidden> <textarea id=about rows=2 name=about cols=20 aria-hidden=true><p>test</p></textarea>
<label>Search: <input type=text aria-controls=company></label> Using Datatables , how would i added a class to
I have the following jQuery template and I need to keep track of the
While styling the jQuery autocomplete plugin, I get the following HTML code hardwired to
The following CSS is returning these 2 fields using firefinder. tr[class=ui-widget-content footrow footrow-ltr] td[aria-describedby*=Active_Customers]
i am generating following html in my web page using jquery. <input id=left_div_foretagname class=userinfofont

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.