Insert the following into the input tag:
onclick="if(this.value=='Search...'){this.value=''}"
This is responsible for clearing textbox when someone clicks in it.

Insert the following into the input tag:
onblur="if(this.value==''){this.value='Search...'}"
This is responsible for resetting the default text if it was left blank.

So, with some super-basic JavaScript, you can achieve this tiny detail that makes a world of a difference in the world of Interaction Design. Note: Don't forget to change "Search..." to your own value!

@jithil, the answer to that is actually quite simple. Since the "server side" stuff happens before any of the client site code (HTML) is outputted, what you can set the value dynamically to be whatever you want. For example, in PHP, it would be something like this...