- Overview
- Documents
Add Clear is a jQuery plugin that adds a input clearing button on any input you apply it to. It clears the value, and returns focus to that field.
Source: github.com
Jun 22, 2014 in Forms 3617 views
Add Clear is a jQuery plugin that adds a input clearing button on any input you apply it to. It clears the value, and returns focus to that field.
Source: github.com
1. INCLUDE JS FILES
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <script type="text/javascript" src="addclear.js"></script>
2. HTML
<input type="text" name="search" value="" id="search_input">
3. JAVASCRIPT
$(function(){ $("input").addClear(); });
4. OPTIONS
Option | Default | Type |
---|---|---|
closeSymbol | ✖ | string |
top | 1 | number |
right | 4 | number |
returnFocus | true | boolean |
showOnLoad | false | boolean |
hideOnBlur | false | boolean |
onClear | null | function |
Tagged with:
add clear
jquery plugin
clear button
input field
input clearing button
focus
Related Articles