View Full Version : Question on passing a string to a function? Show/hide kind of thing

06-12-2003, 08:17 PM
I'm trying to make a little function that shows an image and description of something when its link is moused over. All the elements are set to style="display:none". I'm trying to pass the ids of the image and the description to the function. This is where I am now:

<script language="JavaScript">

function showsample(x,y) {
var a = new String(x);
var b = new String(y);

window.a.style.display = "block";
window.b.style.display = "block";


Is there any way to do something like this? I want a and b to be the ids. I'm passing them to the function from the mouse over event. I know that window.a.style etc. isn't working.

06-12-2003, 09:19 PM
Quick idea:

function ChangeIt(X){



example to call it


06-12-2003, 09:33 PM
That seems to do the trick, thanks very much!