Hi, all,

Ive currently got a javascript dropdown which changes an image on the page depending on what option is choosen.

Just woundered how i can expand this to make it show some specific text with each option aswell, maybe in a div.

Code:

         <script type="text/javascript">
             var linkData = [
            ['image1.jpg','image1.jpg'],
            ['image2.jpg','image2.jpg'],	
            ['image3.jpg','image3.jpg'],
            ]
			
            //preload the pics
            var picO = new Array();
            for(i=0; i < linkData.length; i++){
                picO[i] = new Image();
                picO[i].src = linkData[i][0];
            }function show(val) {
                document.getElementById('picture').src = picO[val-1].src;
                document.getElementById('caption').href = linkData[val-1][1];
            } window.onload=function(){ show(1); }
        </script>
  
        
            <select name="dropdown" onchange="show(this.value);">
                <option value="1">Option 1</option>
                <option value="2">Option 2</option>
                <option value="3">Option 3</option>

            </select>
            
             <a id="caption" href="#"><img id="picture" src="" /></a>
Regards
David