I am doing an A/B Test. I need to change the image url. I have an https://newimage.svg that needs to replace the srcset img.png with javascript on the console:
<picture class="pic_test">
<source media="(min-width: 992px)" srcset="img.png">
<source media="(min-width: 600px)" srcset="img.png">
<source media="(max-width: 599px)" srcset="img.png">
<img src="img.png">
</picture>
This is an sample of the source structure. I can not put all the inside information because the confidencial job requirement but this is a summary (if adding this could help):
<source media="(min-width: 992px)" class="" src="" data-src="" data-srcset="img.png 960w,img.png 1176w,img.png 1600w,img.png 2400w" srcset="img.png 960w,img.png 1600w,img.png 2400w">
I have try so many things but it is not working. Does anyone knows how to change the image url with javascript or jquery?