Active Inputs Highlighter

by Kaloyan K. Tsvetkov [kaloyan@kaloyan.info]
http://www.kaloyan.info

Step. 1

Create new instance of the class.

var ai = new mrasnika_active_input();

Step. 2

Set the background colors you want to use.

ai.setNormalBackground('#eeeeee');
ai.setActiveBackground('#aaeeaa');

Step. 3

Attach the Run() method to the onLoad event.

<body onLoad="ai.Run();">

Here's the whole thing

	<html>
	<head>
	
	...

	<!-- include JS file -->
	<script src="active-input.js"></script>
	
	<script>
	<!--//
	/**
	* Create new object
	*/
	ai = new mrasnika_active_input();
	
	/**
	* Set the colors
	*/
	ai.setNormalBackground('#eeeeee');
	ai.setActiveBackground('#aaeeaa');
	
	//-->
	</script>
	
	...
	
	</head>

	<body onLoad="ai.Run();">
	
	...
	</body>
	<html/>

This is a test page to demonstrate the JavaScript class which applies different color (highlights) to the input, that currently has the focus

Username
Password
Confirm Password
Email address
First name
Last name
Gender
Country
Notes