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
change the text color of a drop down list

Sometimes the default text color – black – just doesn’t work with your page. You can easily change this color upon page loading or dynamically according to user preferences. We use a style.color statement to access and apply the new color to the page element that is specified with the name= attribute.

We use an onMouseOver event to trigger the JavaScript function that is given in the HEAD of the document. The actual color value stated is a named color and is given as the argument passed to the JavaScript function that was created, in this case changeColor(). The coloring method used may be named colors, hex colors or RGB colors.

<html>
<head>

<script type="text/javascript">
function changeColor(color) {
thisform.elements[0].style.color=color;
}
</script>

</head>

<body>

<p>This example demonstrates how to change the text color of an option list.</p>

<p>Mouse over the three colored table cells, and the option list will change color:</p>

<table width="100%">
<tr>
<td bgcolor="red" onmouseover="changeColor('red')"> </td>
<td bgcolor="blue" onmouseover="changeColor('blue')"> </td>
<td bgcolor="green" onmouseover="changeColor('green')"> </td>
</tr>
</table>

<form name="thisform">
<select>
<option>Mouse over the colored table cells</option>
<option>Mouse over the colored table cells</option>
<option>Mouse over the colored table cells</option>
<option>Mouse over the colored table cells</option>
</select>
</form>

</body>
</html>


Notice that I didn’t give name= or value= values in the option tags in the example. This is because the server-side script doesn’t need them if your form name= attribute is stated. All of the option tags will be treated as part of the form being submitted. It should be noted, though, that you would have to state name= and value= attributes if you’re using more than one form within a single page. This is a browser requirement, not a server-side scripting issue.
I do not employ cookies or tracking devices of any kind