/* if and else to shown image */ var image = document.createElement('img'); if (Math.random() > 0.5) { image.src = 'http://www.catgifpage.com/gifs/318.gif'; } else { image.src = 'http://www.catgifpage.com/gifs/320.gif'; } document.body.appendChild(image);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter