-3

How can I make this in JQuery? I need it to show the keyword if there is text in the value input.

http://imageshack.us/a/img849/3262/searchg.jpg

Stefan Frederiksen
  • 135
  • 2
  • 3
  • 15
  • You want to make a picture with jquery, right? You have to elaborate a little more... – A. Wolff Apr 27 '13 at 17:38
  • No... easier to describe – Stefan Frederiksen Apr 27 '13 at 17:52
  • not for a blind person – A. Wolff Apr 27 '13 at 17:55
  • If you do not care about supporting IE 8 or 9 you can use the HTML 5 `placeholder` attribute. If you do want to support IE 8 and 9 then you can use [modernizr](http://modernizr.com/) combined with [yepnope.js](http://yepnopejs.com/) to conditionally load a polyfill (such as [this](https://github.com/ginader/HTML5-placeholder-polyfill)) to enable support for older browsers (such as IE 8 and 9). – War10ck Apr 27 '13 at 18:00

2 Answers2

2

Provided you're fine with not supporting 30% of the market (it's a HTML5 feature not supported in some legacy browsers) you can simply use

 <input value="" placeholder="Your placeholder text">

or otherwise add this jquery plugin to make it work everywhere.

David Mulder
  • 26,123
  • 9
  • 51
  • 114
0

Have you tried using placeholder text?

<form>
  <input name="q" placeholder="Search uploads">
  <input type="submit" value="Search">
</form>
Adam Pearce
  • 9,243
  • 2
  • 38
  • 35