The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I am new to JavaScript, and I am playing with this line of code that to my knowledge is correct but it will not run. The code is:
<body onmousedown="document.bgcolor='#0000CC'"> I press the left mouse button down and it doesn't work; any ideas as to why? |
|
#2
|
|||
|
|||
|
without checking I believe the function is onMouseDown not onmousedown. Javascript functions are case senstive.
|
|
#3
|
|||
|
|||
|
I have this <body onMouseDown="document.bgcolor='blue'"> and it still isn't changing the bgcolor. Anyone know why that is?
|
|
#4
|
||||
|
||||
|
Code:
function updateBody()
{
document.getElementsByTagName('body')[0].style.background = 'blue';
}
document.getElementsByTagName('body')[0].onmousedown = updateBody;
|
![]() |
|
|