First, create your form. Take note of the Input ID, you're going to use this to identify it in jQuery. Also create an open div as an example.
Next, style each enough that you'll be able to see the edits you'll be making.
Now, add your jQuery.
The .css() method will change each color with the value that is given. The extra keypress method just makes the color change when you hit Enter on the keyboard after entering a value. Without that function it will change when you click elsewhere on the page.