Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make part of input[text] grey?

You know how google instant, when they provide suggestions, the bit of the search field that they suggested turns grey, but the bit you typed is always black. Well I want to achieve the same effect with a similar system. How would I go about this?

Thanks, Fela

like image 906
Fela Maslen Avatar asked Nov 28 '25 21:11

Fela Maslen


1 Answers

You will need 2 textboxes positioned on top of each other. Make the textbox on top have a transparent background (these will be the selectable textbox). Then set the color of the textbox behind to grey (this will be the textbox displaying the suggestion).

like image 172
Curtis Avatar answered Dec 01 '25 11:12

Curtis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!