# Need help with a weird javascript random image generator

**URL:** <https://forum.kirupa.com/t/need-help-with-a-weird-javascript-random-image-generator/187821>\
**Category:** web dev\
**Created:** [May 2, 2006, 4:13pm UTC](https://forum.kirupa.com/t/need-help-with-a-weird-javascript-random-image-generator/187821 "2006-05-02T16:13:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjmancini](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jjmancini](https://forum.kirupa.com/u/jjmancini)\
**Post date:** [May 2, 2006, 4:13pm UTC](https://forum.kirupa.com/t/need-help-with-a-weird-javascript-random-image-generator/187821/1 "2006-05-02T16:13:57Z")

</div>

Hey Everyone!

I was wondering how to make a random image generator in javascript that pulls 2 linked images. For example, I have 3 sets of 2 images.

**set 1**  
sunset-top.gif  
sunset-bot.gif

**set 2**  
frog-top.gif  
frog-bot.gif

**set3**  
soup-top.gif  
soup-bot.gif

I want the random image generator to randomize between the sets.And then be able to define where each image is placed on the page.

I really have no idea where to start. It should be really simple, I’m just not to good at javascript. Thanks a bunch to anyone who help out!
