Coding Global Background
Coding Global
","comment":[{"@type":"Comment","author":{"@type":"Person","name":"WILLIAMXU","url":"https://discord.com/users/1406953741202227216","image":"https://cdn.discordapp.com/avatars/1406953741202227216/e54b4feb357ec4ef935bd92af87da9ff.webp"},"datePublished":"2025-09-12T20:43:21.031Z","text":"Use typescript"},{"@type":"Comment","author":{"@type":"Person","name":"WILLIAMXU","url":"https://discord.com/users/1406953741202227216","image":"https://cdn.discordapp.com/avatars/1406953741202227216/e54b4feb357ec4ef935bd92af87da9ff.webp"},"datePublished":"2025-09-12T21:16:11.247Z","text":"And little of ai"}],"image":"https://cdn.discordapp.com/attachments/1407125323719381002/1407125324839256064/Screenshot_2025-08-18_181314.png?ex=699ecb54&is=699d79d4&hm=33584525ae71849c17e5fe030948224a932fb71eee4ecdb4bd5ccfc413e4b6a9&"}

quantity

html & css
Archiviert 4 months ago
2 Nachrichten
0 Mitglieder
Erstellt 6 months ago
Aktualisiert 6 months ago
In Discord öffnen
S
spanish0778
Verified
building a website selling goods. Would this be good for adding/decreasing the quantity of a product.
<div style="display: flex; align-items: center; gap: 7px;">

<button onclick="decreaseQty()">−</button>
<input type="number" id="quantity" value="1" min="1" style="width: 50px; text-align: center;" />
<button onclick="increaseQty()">+</button>
</div>

<script>
function increaseQty() {
let qty = document.getElementById("quantity");
qty.value = parseInt(qty.value) + 1;
}

function decreaseQty() {
let qty = document.getElementById("quantity");
if (parseInt(qty.value) > parseInt(qty.min)) {
qty.value = parseInt(qty.value) - 1;
}
}</script>
quantity

Antworten (2)