Adding alt-text to a dynamic theme | Experience Community
Skip to main content
Question

Adding alt-text to a dynamic theme

  • Jan 15, 2025 3:21 PM UTC
  • 2 replies
  • 152 views

Forum|alt.badge.img

Currently the HTML code for my logo image says the alt text is “logo”. Is there a way to change this to something more specific? I have tried to enter the following code into the footer text box within the theme section but it just adds it to the footer section of the HTML code. 

<script>

document.querySelector(‘#Logo > img’).alt = “Insert Alt Text Here” 

</script>

2 replies

Aggarwal
Level 4 ●●●●
Forum|alt.badge.img+15
  • Level 4 ●●●●
  • Jan 15, 2025 3:51 PM UTC

You can update the code and add to headerbor footer to wait for logo to upload.. 

 

<script>
  document.addEventListener("DOMContentLoaded", function() {
    const logoImg = document.querySelector('#Logo > img');
    if (logoImg) {
      logoImg.alt = "Your Specific Alt Text Here";
    }
  });
</script>
 


c.rose
Level 3 ●●●
Forum|alt.badge.img+13
  • Level 3 ●●●
  • Jan 20, 2025 10:16 PM UTC

Is this the HTML support gave? If so it didn’t work unfortunately for us either. We used JS like the commenter above suggested and that worked for us instead.