Purchase Advertising On AWT
 Upload & Sell Your Software
 Upload & Sell Your eBook
 Enter The AWT Control Panel  Contact Applied Web Tools
 Sell Your eBook @ The PDF Store  Password Troubles? Click Here!
Knowledge Center
Want to write for Applied Web Tools? Send your Writer's Query to
Editor@AppliedWebTools.net for details.
HTML
Reference
&
Tutorial
CSS
Reference
&
Tutorial
DOM
Reference
&
Tutorial
JavaScript
Reference
&
Tutorial
50+ Programming Examples
Use HTML, CSS, DOM & JavaScript Together
Misc. Essays & Documents
You'll Find Just About Anything In Here
50+ Web Page Constructions
Learn the Art of Using HTML, CSS, DOM & JavaScript Together
 Changing Background Colors
 Event Triggering With onLoad
 Disabling The Right Click
 DOM Driven Color Changing
 Switching Images
 innerHTML Attribute Access
 Change With innerHTML
 Changing Positions
 Change Position With onMouseMove
 Change Text Position
 Interactivity Skills
 Type-writing A Message
 Auto-changing Text Size
 Making Text Scroll
 Blinking Text
 Simple Form Authentication
 Change Background Color Of An INPUT
 Change Text Color Of An INPUT
 Change Background Image Of An INPUT
 Select All Checkboxes
 Select Color Of The Submit Button
 Change Text Color Of A Submit Button
 Insert Background Image To A Button
 Change Color Of Drop Down List
 Change Text Color Of A Drop Down List
 Change Color Of A TEXTAREA
 Change The Text Color Of A TEXTAREA
 Insert An Image Into A TEXTAREA
 Change The Size Of An Image
 Change The Source Of An Image
 Change The Position Of An Image
 Change The Background Image
 Moving Images Around The Page
 Drag & Drop An Image
 A Simple Image Viewer
 A Shaking Image
 A Digital Clock
 Drop Down List Link
 Top Drop Down Menu
 Always On Top Menu
 Inset Border Buttons
 A Description Generating Menu
 An Image Generating Menu
 A Horizontal Sliding Menu
 A Click Horizontal Sliding Menu
 Returning Cursor Co-ordinates
 Making Text Follow The Cursor
 Attaching An Image To The Cursor
blinking header

A blinking header is a handy way to add some motion to an otherwise boring document. The blinking effect is achieved by simply changing the text color from the original color to the new color and back again. We use the style.color statement to alter the text color. This color can be stated as a named color, hex color, or RGB color.

<html>
<head>

<script type="text/javascript">
function blinking_header() {
if (!document.getElementById('blink').style.color) {
document.getElementById('blink').style.color="red";
}

if (document.getElementById('blink').style.color=="red") {
document.getElementById('blink').style.color="black";
} else {
document.getElementById('blink').style.color="red";
}

timer=setTimeout("blinking_header()",100);
}

function stoptimer() {
clearTimeout(timer);
}
</script>

</head>

<body onload="blinking_header()" onunload="stoptimer()">

<h1 id="blink">Blinking header</h1>

</body>
</html>


Two event handlers were used (onLoad and onUnload) in the BODY tag to activate the JavaScript functions given in the HEAD of the document. An id attribute has been set to tell the script which page element to apply the changes to. You may use many different color changes on many different page elements with one event handler to change them all at the same time or you can alter one at a time. Just use many different and unique id values.

You may use a variable name instead of the named color we used as well. This is so the decision to select the color being changed exists. This decision can be made by other JavaScript functions. The function decides the value and makes it available to the style.color statement. The event handler activates the function and the change is made.

I do not employ cookies or tracking devices of any kind