noway noway - 1 year ago 60
jQuery Question

Text inputs with 'X' icon to clear the field once you start typing

Search inputs are styled with pill-shaped corners and adds an "x" icon to clear the field once you start typing.

Can I do the same for regular text boxes? See the fiddle please: http://jsfiddle.net/nvWnx/1/

Answer Source

Just add data-type="search" to the text input, and it will receive the same style as the search box, but that will also include the magnifying glass, here are some option:

FIDDLE

A little fiddling around, came up with this:

FIDDLE2