<div class="alert alert-success"> <span style="color:#000;"><strong>Số lượng Pizza:</strong></span> <input type="text" id="number" name="number" style="width: 30%;background:#fff;color:#000;"> <input type="submit" value="Xác nhận" onclick="getcube()" style="background: #FFF;color: #000;padding: 5px;font-size: 18px;"> </div>
.alert-success {
color: #468847;
background-color: #dfeedf;
border-color: #c4e0c4;
}
.alert {
border-radius: 0.1875rem;
padding: 0.938rem;
margin-bottom: 1.5rem;
text-shadow: none;
}
function getcube() {
var value = Number(document.getElementById('number').value);
if (value >= 1 && value <= 10) {
alert('Đặt hàng thành công!');
} else if (value >= 11 && value <= 99) {
alert('Mỗi lần đặt hàng, bạn chỉ có thể đặt tối đa 10 chiếc pizza.');
} else {
alert('Số lượng pizza bạn đặt không hợp lệ. Vui lòng thử lại.');
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.