Input field automatically hide text on click

There is a feature that has been implemented on various websites that when you click on the input field, the text disappear and the users enter their info.

Normally, you will need to know the value of the input field first to make this feature work. However, there is another way as shown below.

Here is a snippet that hide text of the input filed without knowing the value of the input field first:

You need to include jQuery first to use this snippet