Change Layer Colors

By Antonio Lupetti on Mar 17, 2008

General

Use these two simple functions to change text and background colors within a specified layer without reloading the page. Can be used separately or together.


Example 1
Change the background color using a fixed color in the script

» Change Background color

Watch the background color change!


Example 2
Change text and background color with user-selected colors:

Text color:

Background color:

» Change text and background color
Watch the text and background colors change!

Notes

  • Created by: Antonio Lupetti
  • Web Site: http://woork.blogspot.com/
  • Posted: March 17, 2008

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: changeLayerColors.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Comments

Blog comments powered by Disqus