# Goto random url

**URL:** https://forum.kirupa.com/t/goto-random-url/168784
**Category:** Uncategorized
**Created:** [November 10, 2005, 12:35am UTC](https://forum.kirupa.com/t/goto-random-url/168784 "2005-11-10T00:35:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jimmyo](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@jimmyo](https://forum.kirupa.com/u/jimmyo)
#### Post date: [November 10, 2005, 12:35am UTC](https://forum.kirupa.com/t/goto-random-url/168784/1 "2005-11-10T00:35:18Z")

</div>

Hi All

I’m using an array called links with 29 urls titled “pic1.htm”, “pic2.htm”, “pic3.htm” etc. I want to produce some code which goes to one of these pages at random upon the event of moving the mouse out of an image. I can’t seem to get the syntax right. If I place a proper url in place of pic[1].htm it works fine. How do I add the “i” variable to the url?

```auto

 <p align="center"><img src="images/pic1.jpg" width="240" height="180" onMouseOut="goToURL('pic*.htm')"></p>
 

```

Thanks

Jim
