Documentation > JavaScript API > Public methods
Gets raw value without any format pattern or delimiter, normally you should pass over this value to model or backend.
cleave.getRawValue();
Sets raw value, it will then apply formatting automatically.
cleave.setRawValue('5555444433332222');
Gets formatted pretty value, this is same as DOMInputElement.value
.
cleave.getFormattedValue();
Gets ISO format date value, this only works for date input type.
cleave.getISOFormatDate();
Garbage collection, removes all listeners.
cleave.destroy();
Sets / Changes country region code.
You will only need to call this when dealing with country switching for a phone input field.
e.g. user selected a different country option via <select>
, which triggered the country change. See more in documentation phone lib addon section.