How to apply switching images in AMP without using javascript?
How can I apply the switching images in AMP? I know that we can't use javascript in AMP. Please help.
Here's the javascript code:
<p id="sidebar-banner-switch"></p>
<script>
if (Math.random() < 0.5) {
text = "<a href='#' target='_blank'><img src='/wp-content/uploads/2016/06/banner_001.gif/></a>";
} else {
text = "<a href='#' target='_blank'><img src='/wp-content/uploads/2016/06/banner_002.gif'/></a>";;
}
document.getElementById("sidebar-banner-switch").innerHTML = text;
</script>
Thank you.
Cheers,