I am trying to limit the qty a customer can order using the below script. The script is supposed to change the quantity input tag to have max="5", but it is not working.
Is the issue with my code, or something to do with SquareSpace? I do know that the page loads with max="9999" by default, is there something I'm missing to override that?
<script>
var qty = document.querySelectorAll('input[type="number"]');
qty.setAttribute('max', '5');
</script>