How to access the html value of this specific element?

Solution 1
"use strict";
function myFunction(form, name, brand, price) {
   let quantity = form.querySelector(".quant");
   console.log("quantity for purchase is " + quantity.value);
}
Solution 2
const forms = document.querySelectorAll('.article-form');

for (const form of forms) {
  form.addEventListener('submit', event => {
    event.preventDefault();

    const formData = new FormData(form);
    const amount = formData.get('amount');

    if (amount === null || amount === '') {
      alert("Please insert a value before buying");
      return;
    }

    const brand = formData.get('brand');
    const name = formData.get('name');
    const quantity = formData.get('quantity');

    const price = formData.get('price');
    const total = parseInt(price) * amount;
    const text = `Press a button!\n--OK to Purchase (Total price : ${total})\n--Cancel to cancel.`;

    alert("Congrats, the product has been bought");
    const newQuantity = quantity - amount;

    ajaxCall(newQuantity, brand, name);
  });
}