Quantity inputs
Adds custom dynamic quantity adjustment 'spinners' to number input fields.
product.liquid
1
<label for="Quantity" id="quantityWrapper">
2
<span>Quantity</span>
3
<button type="button" class="js" aria-hidden="true" value="-">Decrease</button>
4
<input type="number" id="Quantity" name="quantity" value="1" min="1">
5
<button type="button" class="js" aria-hidden="true" value="+">Increase</button>
6
</label>
Copied!
A class or ID {string} is required.
1
const quantityWrapper = '#quantityWrapper';
2
3
const quantityInputTools = new quantityInputs({
4
quantityWrapper: quantityWrapper,
5
});
6
7
quantityInputTools();
Copied!
Last modified 2yr ago
Copy link