Jump to content

Make Newsletter Block ADA compliant

Recommended Posts

Hi, I have to make a newsletter block in my website ADA compliant. This problem was solved in a different discussion with code to be placed in the footer section, but it doesn't seem to be fixing the errors on AccessScan. I was wondering if there is an issue with the code itself.

Screenshot2024-01-04at3_39_50PM.png.cac73b0d138ab1f9d1c87867f1e9e74f.png

<script>

  // Aria-labels for newsletter
  (function(){
  setTimeout(() => {
    
    document.querySelector('[name="fname"]').setAttribute('aria-label', 'First Name');
    document.querySelector('[name="fname"]').setAttribute('aria-required', 'true');
    
    document.querySelector('[name="lname"]').setAttribute('aria-label', 'Last Name');
    document.querySelector('[name="lname"]').setAttribute('aria-required', 'true');
    

    document.querySelector('[name="email"]').setAttribute('aria-label', 'Email Address');
    document.querySelector('[name="email"]').setAttribute('aria-required', 'true');

  }, 500);
})()
</script>

Link to comment
  • Replies 0
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.