5) CISC_CH9_pp346 application below
Create a checkbox element on the HTML page and an associatedonclick function with this control. Inside the click eventassociated with the checkbox, access the tip percent subtotal andthe tip percentage as was done on the computetip function. Addanother five percent To the tip if the checkbox is clicked, andsubtract five percent from the tip if the checkbox Is not checked.Instead of using windows onload you may use defer in the link tothe js file.
<html>
<head>
<script src =”please_346.js” type = “text/javascript”></script>
</head>
<h1>Tip Calculator</h1>
<div>
<input id=”subtotal” type=”text” size=”5″ /> subtotal<br />
<button id=”tenpercent”>20%</button>
<button id=”fifteenpercent”>15%</button>
<button id=”eighteenpercent”>18%</button>
<span id=”total”></span> </div>
</div>
</html>
PLEASE_346.js
window.onload = function(){
document.getElementById(“tenpercent”).onclick = computeTip;
document.getElementById(“fifteenpercent”).onclick =computeTip;
document.getElementById(“eighteenpercent”).onclick =computeTip;
};
// Computes
PayPal Gateway not configured
PayPal Gateway not configured