function doCalc() { var value1 = document.getElementById("credit1").value; var value2 = document.getElementById("credit2").value; var value3 = document.getElementById("credit3").value; var total = Number(value1) + Number(value2) + Number(value3); document.getElementById("output").value = total; }
1 credit hour: <input type="number" id="credit1"> <br /> 2 credit hour: <input type="number" id="credit2"> <br /> 3 credit hour: <input type="number" id="credit3"> <br /> Total: <input id="output"> <br /> <button >Calculate</button>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)