JavaScript
- 2 ответа
- 0 вопросов
0
Вклад в тег
$("input#email").inputmask({
mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]",
greedy: false,
clearMaskOnLostFocus: false,
onBeforeWrite: function (event, buffer, caretPos, opts) {
buffer.forEach(function(item, i, buffer) {
if (item == '@') {
buffer[i+1] = 'g';
buffer[i+2] = 'm';
buffer[i+3] = 'a';
buffer[i+4] = 'i';
buffer[i+5] = 'l';
buffer[i+6] = '.';
buffer[i+7] = 'c';
buffer[i+8] = 'o';
buffer[i+9] = 'm';
buffer.length = i+10;
}
});
}
});