Forum Moderators: mack

Message Too Old, No Replies

Two events on a single click

         

inarbeth

10:14 pm on Nov 16, 2003 (gmt 0)

10+ Year Member



I am using a javascript to change the colour of the background in a frame when text is clicked. I want to use the same click to change the content of the main frame. What code do I use to do this?
My link text is <a target="main" href="PageOne.htm">Click here

I want to combine that with
<!-- Begin
var backColor = new Array();
backColor[0] = 'white';
backColor[1] = '#0F3C5D';
backColor[2] = '#CC0000';
backColor[3] = '#F84298';

function changeBG(whichColor){
document.bgColor = backColor[whichColor];
}
// End -->

and to use this to change the colour

<a href="javascript:changeBG(2)">Click here</a>

le_gber

9:44 am on Nov 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the page you are trying to change the bg color to?

If the one with the link:

<a target="main" href="PageOne.htm" onClick="changeBG(2);">

should work

Leo