1.0.3 • Published 8 years ago

input-clearout v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

input-clearout

This is a web component that will clear value from an input field.

Demo

Demo

Install

Install the component using NPM:

$ npm i input-clearout --save

Usage

Import Web Components' polyfill:

npm install https://github.com/WebReflection/document-register-element

Add Custom Element Script:

<script src="../dist/input-clearout.js"></script>

Start using it!

<cs-clearout></cs-clearout>
<cs-clearout relative="true" input=".user-success" css="fa fa-times-circle-o" html="<div class='testing'></div>"></cs-clearout>

##Options

AttributeOptionsDefaultDescription
relativeBooleannullAdds inline css style position: relative to parentNode
inputStringsibling type INPUTAdd the cssSelector for the input to change. Needs to be inside the parentNode
cssStringfa fa-times-circle-oThis is css class names for glyph. Default is using font awesome.
htmlString<span class="fa fa-times-circle-o"></span>This is the innerHTML used to create element.