I'm starting the studies with pure JavaScript, to practice better I created a table as if they were ordering from a pizzeria, and I put some field (taste, quantity and value). At the end of the line I have a "+" button. The idea is that when I click on it, add to the quantity field. For this, I imagined that it would be started this way at least to get this field, but when I try to print it it displays msg of undefined
:
//CAPTURA O BOTÃO +
var botaoSoma = document.querySelector(".btnSoma");
// CAPTURA A QUANTIDADE DA PIZZA
var calabresaQtd = document.querySelector("#quantidade_calabresa");
//ACRESCENTA UM EVENTO AO CLICAR NO BOTÃO + E IMPRIME A QUANTIDADE DE PIZZA
botaoSoma.addEventListener('click', function(){
alert(calabresaQtd.value);
});