Now that with Ext Core a light-weight version (just 25kB) of ExtJS has been released, I thought it’s time to build a nice example with it.

The result is something very useful that you can see in actually a lot of web sites: Display a info text inside of a input text field if it is empty and does not have the focus.

Here’s how it looks like:

E-Mail:

To add this behaviour to a input field you just have to call this single line:

Extensive.behaviours.setInfoText(inputElement, 'Your email like max@mustermann.de');

As always you can find the code for this component in a library called ‘extensive’. Feel free to support the project by participating.