Bootstrap + JQuery, Input Clear Button
Load the script in your project.
<script src="jquery.bootstrap-pureClearButton.js"></script>Adding the data-pure-clear-button attribute to your text fields.
<input type="text" data-pure-clear-button>
<input type="text" data-pure-clear-button="true">- text
- password
- url
- search
- tel
- number
- datetime
- .pureClearButtn('create')
Create the clear button in HTML DOM.
$("#inputText").pureClearButton('create');- .pureClearButtn('destroy')
Remove the clear button in HTML DOM.
$("#inputText").pureClearButton('destroy');- .pureClearButtn('show')
show a clear button on the display. (css, display:block)
$("#inputText").pureClearButton('show');- .pureClearButtn('hide')
Do not show a clear button on the display. (css, display:none)
$("#inputText").pureClearButton('hide');