Роман Андреевич,
document.addEventListener('input', function (e) {
var target = e.target;
clearTimeout(target.timeoutId);
if (target.tagName == 'INPUT') {
if (target.hasAttribute('data-action') {
if (target.getAttribute('data-action') == 'refresh') {
target.timeoutId = setTimeout(function () {
console.log(target.value);
}, 2000);
}
}
}
};