Is there a way to add alt text to an A/B hero image test in target? | Community
Skip to main content
angiep33244241
March 2, 2020
Solved

Is there a way to add alt text to an A/B hero image test in target?

  • March 2, 2020
  • 1 reply
  • 3120 views

Hi all, 

 

I'm currently running an A/B image test and want to know if there is any way to add alt text to the image I'm testing within adobe target? We would usually have alt text added on our backend but since we are testing the image through Target we can't add it like that. 

 

Has anyone else ran into this and if so, how what were the steps you took to add alt text?

 

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rajneesh_Gautam_

Hi @angiep33244241 

 

You can use custom code to change Alt text:

 

// jQuery
$('img').filter(':first').attr('alt', 'My image')

// Vanilla
document.querySelector('img').setAttribute('alt', 'My image')

from: https://gist.github.com/joyrexus/7307312

 

 

1 reply

Rajneesh_Gautam_
Community Advisor
Rajneesh_Gautam_Community AdvisorAccepted solution
Community Advisor
March 3, 2020

Hi @angiep33244241 

 

You can use custom code to change Alt text:

 

// jQuery
$('img').filter(':first').attr('alt', 'My image')

// Vanilla
document.querySelector('img').setAttribute('alt', 'My image')

from: https://gist.github.com/joyrexus/7307312