This recipe will outline the steps required to add a default string of text to the search textfield. The text will only be visible when the field does not have keyboard focus.
We will be using the mysite module created earlier in this book to hold our odds and ends. It is assumed that this module has been created and is enabled. It is also assumed that the search module has been enabled with appropriate permissions granted, and that the search block is active for our theme and is visible on all pages. In our example, the search block has been placed in the header region.
The jQuery plugin repository provides a number of solutions at http://plugins.jquery.com/plugin-tags/default-text that could be used to accomplish our goal. While they might simplify the jQuery required and perhaps offer a few more options, we will be making do without them for this recipe.