0

As far as I know, aria-required and aria-invalid attributes are positioned on the input tag where you embed the v-validate attribute. Eg.

<input class="a" type="text" v-validate="'required'">

will manifest itself as:

<input class="a" type="text" aria-required="true" aria-invalid>

in the DOM.

If I had a div around my input, is it possible for the aria attributes to manifest in the div? So that it will look like:

<div class="b" aria-required="'true'" aria-invalid>
  <input class="a" type="text">
</div>
randomguy
  • 31
  • 2
  • 6

1 Answers1

0

Refer to: developer.mozilla.org

The aria-required attribute is used to indicate that user input is required on an element before a form can be submitted. This attribute can be used with any typical HTML form element. And <div> tag is not a form element so it can not be used with aria attribute.

An Nguyen
  • 288
  • 1
  • 15
  • That's weird, I believe it can be used with aria attribute because I'm looking at one right now. I'm tasked with converting a current website to use vue.js for the front-end and one of the some of the CSS are reliant on the value of the aria-attributes in the
    tag.
    – randomguy Dec 13 '18 at 06:51