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

Adding alt-text to a dynamic theme

  • January 15, 2025
  • 2 replies
  • 31 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 ●●●●
  • 134 replies
  • January 15, 2025

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 2 ●●
Forum|alt.badge.img+9
  • Level 2 ●●
  • 26 replies
  • January 20, 2025

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.


Leave a Reply