Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 28th, 2005, 10:10 AM
Authorized User
 
Join Date: Aug 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default changing background

Hi there!

Does somebody knows how to change the background color with JavaScript?

Thank you in advance! Thijs from the Netherlands!

 
Old September 2nd, 2005, 07:37 AM
Authorized User
 
Join Date: Jul 2005
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Save this in an HTML Page and try:

<a href='#' onClick="javascript:document.body.style.background Color='red';">Red</a> |
<a href='#' onClick="javascript:document.body.style.background Color='blue';">Blue</a>
<a href='#' onClick="javascript:document.body.style.background Color='white';">White</a>


Vasudevan Deepak Kumar
Personal Web: http://www.lavanyadeepak.tk/
I Blog At: http://deepak.blogdrive.com/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Clickable background AbrarNazeer CSS Cascading Style Sheets 4 April 9th, 2008 12:22 AM
Table row background colour changing meetravig Java GUI 0 September 21st, 2007 05:06 AM
Changing the Page's Background Image Aaron Edwards ASP.NET 2.0 Basics 0 October 7th, 2006 02:28 PM
background picture p_gauri7 Crystal Reports 1 February 18th, 2005 06:22 AM
Changing Text Box Background Color rodmcleay Javascript How-To 9 December 11th, 2003 05:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.