JSFiddle - React, Tailwind, and code Playground
HTML
<td>Blazer (All Sizes) - $200</td>
<td><button onclick="small()">Small</button>
<p><button onclick="medium()">Medium</button> </p>
<button onclick="large()">Large</button> </td>
<td><button onclick="quantitynumber()">Enter Quantity</button> </td>
<td><button onclick="confirmorder()">Confirm Order</button>
JavaScript
var blz = 0
function small()
{
blz = confirm ('You have selected size: Small. Confirm?')
}
function medium()
{
blz = confirm ('You have selected size: Medium. Confirm?')
}
function large()
{
blz = confirm ('You have selected size: Large. Confirm?')
}
function quantitynumber()
{
blz = prompt ('Enter the number of Blazer(s) to order')
blz1 = blz * 200
if ( blz == 1) {
blz1 = confirm ('You have chosen to order 1 Blazer for $' + blz1 + '. Confirm?')
}
else if ( blz >=2 && blz <= 5) {
blz1 = confirm ('You have chosen to order ' + blz + ' Blazers for $' + blz1 + '. Confirm?')
}
else if (blz >5) {
alert('There is a limit of 5 Blazers per customer.')
blz = null
blz1= null
}
else if (blz = isNaN || blz == '') {
alert ('Please type in a valid number.')
}
}
function confirmorder()
{
if (blz == small && blz >= 1 && blz <= 5) {
blz1 = confirm ('You have chosen to confirm ' + blz + ' small sized Blazers for $' + blz1 + '. Confirm?')
}
}