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 this
I am looking for a JQuery plugin that can add that to a textbox for me. Any 开发者_StackOverflow中文版help is appreciated.
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.
精彩评论