Skip to content

Dispatch a 'filled' and 'empty' event against text inputs, selects and textareas whenever the field is filled or emptied.

License

Notifications You must be signed in to change notification settings

jonolock91/manhattan-js-field-filled

 
 

Repository files navigation

Manhattan Field Filled

Dispatch a 'filled' and 'empty' event against text inputs, selects and textareas whenever the field is filled or emptied.

npm version Build Status Coverage Status dependencies status

Installation

npm install manhattan-field-filled --save-dev

Usage

import * as $ from 'manhattan-essentials'
import {addFilled} from 'manhattan-field-filled' 


$.listen(
    $.one('.some-input'),
    {
        'empty': (ev) => {
            this.classList.add('empty')
        },
        'filled': (ev) => {
            this.classList.add('filled')
        }
    }
)

addFilled()

About

Dispatch a 'filled' and 'empty' event against text inputs, selects and textareas whenever the field is filled or emptied.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 92.3%
  • HTML 7.7%