armstid
11-08-2003, 10:47 AM
On a regular .htm page, I have called a js page:
<script language=JavaScript src="pop2.js"></script>
On the htm page I want a form button to be called that when it is clicked changes the background color.
So I have this in pop2.js:
document.write('<form><input type="button" name="button" style="" value="CLICK ME TO CHANGE THE BACKGROUND COLOR" onclick="change()"></form>');
change()
{
document.bgColor = '#F8BDC2';
}
The button is called, but I can't get the change() function to work when the button is clicked. Could someone plase help me?
Thanks :)
<script language=JavaScript src="pop2.js"></script>
On the htm page I want a form button to be called that when it is clicked changes the background color.
So I have this in pop2.js:
document.write('<form><input type="button" name="button" style="" value="CLICK ME TO CHANGE THE BACKGROUND COLOR" onclick="change()"></form>');
change()
{
document.bgColor = '#F8BDC2';
}
The button is called, but I can't get the change() function to work when the button is clicked. Could someone plase help me?
Thanks :)