Element.ariaRequired is an instance property that reflects the aria-required attribute. Learn the true and false tokens, when to prefer native required, and how to get or set the property from JavaScript—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String
03
Values
true · false
04
Reflects
aria-required
05
Status
Baseline widely
06
Common with
role="textbox"
Fundamentals
Introduction
Some form fields are optional. Others must be filled before submit—email, password, or article tags. Assistive technologies need a clear required signal, not only a red asterisk on the screen.
aria-required carries that signal. ariaRequired is the JavaScript reflection of that attribute.
JavaScript
const el = document.getElementById("txtBoxInput");
console.log(el.ariaRequired); // "true"
el.ariaRequired = "false";
💡
Beginner tip (MDN)
Where possible, use an HTML <input type="text"> or a <textarea> with the native required attribute. Prefer ARIA required mainly for custom widgets (for example a role="textbox"). Keep visible labels and validation in sync.
Concept
Understanding the Property
MDN: the ariaRequired property of the Element interface reflects the value of the aria-required attribute, which indicates that user input is required on the element before a form may be submitted.
Reflected attribute — mirrors aria-required.
Get / set — readable and writable string.
Two tokens — true, false.
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaRequired
Value
A string with one of the following values:
Value
Meaning (MDN)
"true"
Users need to provide input before a form is submitted.
"false"
User input is not necessary to submit the form.
⚠️
Signal vs validation
ariaRequired announces the requirement. It does not automatically block submit. Use native required, your own checks, and a clear error message when the field is empty.
Pattern
📋 MDN Example Shape
MDN starts with a contenteditable textbox marked aria-required="true", then updates it to "false":
JavaScript
<div id="txtboxMultilineLabel">Enter the tags for the article</div>
<div
role="textbox"
id="txtBoxInput"
contenteditable="true"
aria-multiline="true"
aria-labelledby="txtboxMultilineLabel"
aria-required="true"
></div>
JavaScript
let el = document.getElementById("txtBoxInput");
console.log(el.ariaRequired); // "true"
el.ariaRequired = "false";
console.log(el.ariaRequired); // "false"
When the field is required, also show a visible cue (for example “required” or an asterisk explained in text) and validate before submit.
Cheat Sheet
⚡ Quick Reference
Goal
Code / note
Read
el.ariaRequired
Mark required
el.ariaRequired = "true"
Mark optional
el.ariaRequired = "false"
Prefer when possible
<input required> / <textarea required>
Typical role
role="textbox"
MDN status
Baseline Widely available
Snapshot
🔍 At a Glance
Four facts about Element.ariaRequired.
Kind
get / set
Instance
Type
string
true / false
Reflects
aria-required
Attribute
Baseline
widely
Oct 2023+
Hands-On
Examples Gallery
Examples follow MDN Element: ariaRequired. Labs use a custom textbox so you can safely read and write the property.
📚 Getting Started
Read the reflected value and follow MDN’s update.
Example 1 — Read ariaRequired
Log whether a custom textbox is required.
JavaScript
const el = document.getElementById("txtBoxInput");
console.log(el.ariaRequired);
// HTML includes: role="textbox" aria-required="true"
Element.ariaRequired is Baseline Widely available (MDN: across browsers since October 2023). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline Widely available
Element.ariaRequired
String true / false — reflects aria-required for required form input.
BaselineWidely available
Google ChromeSupported (ARIA reflection)
Yes
Microsoft EdgeSupported (ARIA reflection)
Yes
Mozilla FirefoxSupported (ARIA reflection)
Yes
Apple SafariSupported (ARIA reflection)
Yes
OperaFollow Chromium support
Yes
Internet ExplorerNo ariaRequired IDL — use setAttribute
No
ariaRequiredBaseline
Bottom line: Use ariaRequired on custom widgets to declare required input before submit. Prefer native required when you can. Keep visible cues and validation in sync with the value.
Wrap Up
Conclusion
ariaRequired reflects aria-required so custom form widgets can declare that input is required before submit. Prefer native required when possible, and keep visible cues plus validation aligned with the announced token.
Reflected aria-required string for required form input.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
true / false
required vs optional
Values
🔍03
Prefer native
required attr
MDN
✅04
Baseline
widely available
Status
🎯05
Validate too
not signal only
Rule
❓ Frequently Asked Questions
It reflects the aria-required attribute as a string, indicating that user input is required on the element before a form may be submitted.
No. MDN marks Element.ariaRequired as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
The strings "true" (users must provide input before submit) or "false" (input is not necessary to submit the form).
Yes when possible. MDN recommends an HTML input with type="text" or a textarea (with the required attribute) because they have built-in semantics and do not require ARIA attributes.
No. It tells assistive technologies the field is required. You still need visible cues and validation logic (or native required) to enforce the rule.
Yes. Reading and writing ariaRequired updates the reflected aria-required attribute. Keep UI labels and validation behavior in sync with the value.
Did you know?
Native required on an <input> also participates in HTML constraint validation. aria-required on a custom textbox announces the same idea to assistive technologies, but your script still must enforce the rule.