I want to extract the βvalueβ attribute from a selection box that allows users to select the quantity quantities of a particular item on my website.
I am new to Javascript and HTML. When I do "Validation Element", I see an attribute in the element
<input size="2" type="text" autocomplete="off" class="cart_quantity_input form-control grey" value="2" name="quantity_8329349_28095_0_12035">
But when I try to do one of the following two things, the Google Tag Manager says the variable is undefined
document.querySelectorAll("input.cart_quantity_input.form-control.grey").value
OR
document.querySelectorAll("input.cart_quantity_input.form-control.grey").getAttribute("value")
Order Transaction URL www.decathlon.in/order
source share