How do I put a clear button inside my HTML text input box like the iPhone does?

前端 未结 10 2035
太阳男子
太阳男子 2020-12-02 04:21

I want to have a nice little icon that, when clicked will clear the text in the box.

This is to save space rather than having a clear link outside of t

10条回答
  •  春和景丽
    2020-12-02 05:21

    Check out our jQuery-ClearSearch plugin. It's a configurable jQuery plugin - adapting it to your needs by styling the input field is straightforward. Just use it as follows:

    
    
    
    

    ​ Example: http://jsfiddle.net/wldaunfr/FERw3/

提交回复
热议问题