cleave.js demo - use value for phone
by nosir
HTML
<script src="https://nosir.github.io/cleave.js/dist/cleave.min.js"></script>
<script src="https://nosir.github.io/cleave.js/lib/cleave-phone.i18n.js"></script>
<div>
<section>
<input class="input-0" value="+7"/>
</section>
</div>
CSS
input {
display: block;
outline: none;
-webkit-appearance: none;
border: 1px solid #e6e6e6;
border-radius: 5px;
background-color: #fff;
line-height: 30px;
vertical-align: middle;
height: 33px;
width: 170px;
font-size: 14px;
padding: 0 8px;
}
.input-numeral {
text-align: right;
}
.right {
text-align: right;
}
body {
font-family: sans-serif;
}
p {
margin: 0;
padding: 0 0 5px 0;
font-size: 14px;
color: #666;
}
section {
margin-bottom: 10px;
}
JavaScript
new Cleave('.input-0', {
phone: true
});