Create new instance of the class.
var ai = new mrasnika_active_input();
Set the background colors you want to use.
ai.setNormalBackground('#eeeeee'); ai.setActiveBackground('#aaeeaa');
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