Gluip
Gluip

Reputation: 2987

jquery plugin to display a 'clear' button in a search input box

I am having trouble trying to find something I know that does exist. In some forms your can clear your textbox by clicking on a 'cross'. It looks like thisenter image description here

I am looking for a JQuery plugin that can add that to a textbox for me. Any help is appreciated.

Upvotes: 1

Views: 2900

Answers (1)

Alex
Alex

Reputation: 9031

Hows this for an option:

http://jsfiddle.net/ajthomascouk/hQLzX/

So basically i've enclosed the input and img inside a span, which will act as the parent.

UPDATE

I've improved my answer - http://jsfiddle.net/ajthomascouk/apgws/

Still does the same thing except now you dont have to hard code it, jQuery will do it.

Upvotes: 4

Related Questions