Cleave.js Documentation

July 7, 2016 ยท View on GitHub

Documentation > JavaScript API > Constructor

Constructor

new Cleave(selector|element, [options])

Creating an instance by providing an input field, it can be either HTML selector or the dom element.

The options is an object documented in the Options section.

With the instance created, you can call these Public methods.

var cleave = new Cleave('.my-input', {
    creditCard: true
});

Contents

  1. 1Constructor
  2. 1.1new Cleave(selector|element, [options])