Expand my Community achievements bar.

SOLVED

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

Avatar

Level 1

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!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

 

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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