Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why fail? --> <span onclick="document.bgColor = 'grey';">Grey

Status
Not open for further replies.

cy360

Programmer
Dec 19, 2009
2
US
<span onclick="document.bgColor = 'grey';">Grey</span>
does not change the page grey on this page:


any ideas why? I think something is blocking it because if I use that code on a blank html it works.
 
Hi

I am with the browser : neither I would change the color.
Code:
[b]<span[/b] [maroon]onclick[/maroon][teal]=[/teal][green][i]"document.body.style.backgroundColor = 'grey';"[/i][/green][b]>[/b]Grey[b]</span>[/b]
Note that [tt]bgColor[/tt] was a nonstandard Explorer-only property, declared deprecated by Microsoft themselves.


Feherke.
 
Thanks for the information feherke. I must have pulled up an outdated page when I ran into document.bgColor.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top