window.addEventListener('DOMContentLoaded', () => {
const buttons = document.querySelectorAll('.btn')
const rowSelector = document.querySelector('.block__row')
let newValues = ['2', '567', 'Т333', 'csdf', 'sdfdsggg', 'ertretret']
function changeValue(btn, newArr) {
for (let i = 0; i < btn.length; i++) {
btn[i].setAttribute('value', newArr[i])
}
}
function consoleOutput(parentSelector) {
parentSelector.addEventListener('click', (e) => {
if (!e.target.matches('input')) return
changeValue(buttons, newValues)
console.log(e.target.getAttribute('value'))
})
}
consoleOutput(rowSelector)
})