JavaScript
4
Вклад в тег
let input = document.body.firstElementChild;
let arr = ['test']
function findWord(input, arr, callback) {
input.addEventListener('input', function (e) {
arr.forEach(function(item, i, arr) {
if (input.value.indexOf(item) >= 0) {
callback(item);
}
})
})
}
function test(item) {
alert(item)
}
findWord(input, arr, test)
function render() {
countField.value = countFieldValue;
}
countMinus.addEventListener('click', function() {
countFieldValue--;
render()
});
countPlus.addEventListener('click', function() {
countFieldValue++;
render()
});