Logo alt text script not working on Simple Layout | XM Community
Skip to main content
Solved

Logo alt text script not working on Simple Layout

  • October 16, 2024
  • 2 replies
  • 85 views

Forum|alt.badge.img+1

Hi all,

I’ve been adding alt text to our university logo using the script that was suggested a few years ago. So far it has been working great, but I just realized that it doesn’t work on the Dynamic theme with the Simple layout (which is supposed to be the most accessible option).

The code I usually use in the Look and Feel > General > Footer source code is:

<script>document.querySelector ('#Logo > img').alt = "add your alt text here"</script>

Any idea why this might not be working in the Simple layout?

Thanks in advance.

Pam

Best answer by Nam Nguyen

@Pjthomas17 Simple layout is the black sheep, because its structure is totally different from the others. This code should work on Simple layout

<script>
document.querySelector('#logo-container > img').alt = "add your alt text here";
</script>

 

2 replies

Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1096 replies
  • Answer
  • October 16, 2024

@Pjthomas17 Simple layout is the black sheep, because its structure is totally different from the others. This code should work on Simple layout

<script>
document.querySelector('#logo-container > img').alt = "add your alt text here";
</script>

 


Forum|alt.badge.img+1
  • Author
  • 1 reply
  • October 16, 2024

Thank you so much!