Append a font-awesome icon to autocomplete search box

How can a search glass icon be inserted in a search input field with auto-complete in a way that it is hidden when input is typed so the “blue cross” is showing only?

image

I tried several ways, among which hiding the icon when the value of the input field’s length > 0, but that doesn’t work because the value is not updated directly when typing. How can the above be achieved?

Thanks for any help.

Community Page
Last updated: