<div class="tip-card">
<h3>Tip Calculator</h3>
<div class="input-group">
<label>Bill Amount</label>
<input type="number" id="bill" placeholder="0.00">
</div>
<div class="input-group">
<label>Service Quality</label>
<select id="service">
<option value="0.30">30% - Outstanding</option>
<option value="0.20" selected>20% - Good</option>
<option value="0.15">15% - OK</option>
<option value="0.10">10% - Bad</option>
</select>
</div>
<div class="result">
<p>Tip Amount: <span id="tipAmount">$0.00</span></p>
<p>Total Bill: <span id="totalBill">$0.00</span></p>
</div>
<button onclick="calculateTip()">Calculate</button>
</div>
Back to Snippets
Tip Calculator JS
Calculate tips instantly with this handy widget. Users enter the bill amount and select a service level to see the total amount, and the math happens in real-time with simple JavaScript.
439