3
I have a text box, a input type text. And I wanted to insert an image in the corner, for example, a magnifying glass. And when the user starts writing, that magnifying glass disappears. It is possible to do this in Javascript?
<input type="text" name="search">
Very good! Thank you!
– pc_oc
@pc_oc, glad I can help.
– Sergio
Okay, the answer is valid, but when I take the input focus, the text superimposes the image.
– Vinicius Lima
@Viniciuslima, can change the
text-indent
not to stand on the image. Example: http://jsfiddle.net/ysB9P/ It is also possible to go via javascript/jQuery but CSS is better. Example: http://jsfiddle.net/Gg9nf/– Sergio