Back to Cleave Js

Cleave.js Documentation

doc/constructor.md

1.6.0704 B
Original Source

Cleave.js Documentation

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.

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