const controle = document.querySelectorAll (".controle-ajuste");
controle.forEach( (elemento) => {
elemento.addEventListener("click", (evento) => {
manipulaDados(evento.target.textContent, evento.target.parentNote);
})
})
function manipulaDados (operacao, controle) {
const peca = controle.querySelector (".controle-contador");
if (operacao === "-"){
peca.value = parseInt (peca.value) - 1;
} else {
peca.value = parseInt (peca.value) + 1 ;
}
}
erro =>
main.js:11 Uncaught TypeError: Cannot read properties of undefined (reading 'querySelector')
at manipulaDados (main.js:11:27)
at HTMLUnknownElement. (main.js:5:9)
`