Inputfield with integrated clear button
I need an input field which should behave like this:
[Enter Text.... (x)]
Firstly: When nothing is entered in the text field it should display a grayish text, which disappears as soon as the user starts typing
Secondly: When the user clicks the (x) Clear button, the text will be deleted and the default gray text is shown again. Example
I guess I could create a jquery selector for all required input fields, which then adds a X Button after the input field. But I don't know how I get this button inside the actual text field. I do not know how to fix the first issue of my problem. Furthermore the text should be seen as empty, even if the text "Enter Text..." is set as the value.
I would appreciate any help...