I am just learning to code, I am at the very beginning. I am trying to code this calculator for my job, I have tried for days, and even researching, I just can't make it work. It's probably the simplest thing ever...I am just in te deepest forest regarding functions! I changed this code so many times I don't even know where I'm at. I'm a mess, help!
function myF() {
var a = document.getElementById("a").value;
var b = document.getElementById("b").value;
var c = document.getElementById("c").value;
var d = document.getElementById("d").value;
var e = document.getElementById("e").value;
var f = document.getElementById("f").value;
var g = document.getElementById("g").value;
var h = document.getElementById("h").value;
var i = document.getElementById("i").value;
var tot = document.getElementById("result").value = a + b + c + d + e + f + g + h + i;
}
body {
background: url(img/Construction-Wallpaper-8.jpg) no-repeat center center;
background-size: 100% 100%;
}
form {
width: 530px;
align-content: center;
margin: 0 auto;
border: solid 1px darkslategrey;
padding: 10px 10px 10px 10px;
display: block;
}
input {
float: right;
clear: both;
position: relative;
top: -4;
}
label {
padding: 8px 10px;
font-family: "Gabriola Regular", arial, sans-serif;
font-size: 18px;
font-weight: bolder;
color: black;
display: block;
}
input#result {
position: relative;
right: 18px;
top: 6px;
}
button#Total {
position: relative;
left: 10px;
top: 5px;
background: linear-gradient(to right, darkslategrey, white);
font-family: "Gabriola Regular", arial, sans-serif;
font-size: 25px;
width: 100px;
height: 30;
text-align: center;
text-transform: uppercase;
box-shadow: 1px 1px 3px;
border: solid 1px black;
}
button#Total:active {
position: relative;
top: 6px;
cursor: pointer;
}
button#Total:hover {
cursor: pointer;
}
p#title {
font-size: 50px;
text-align: center;
padding: 16px 0 0 0;
font-family: "Gabriola Regular", arial, sans-serif;
color: #333;
font-weight: bolder
}
img#Logo {
width: 70px;
display: inline-block;
position: absolute;
top: 8px;
right: 9px;
}
p#Logo {
font-family: "Gabriola Regular", arial, sans-serif;
font-size: 20px;
display: inline-block;
width: 50px;
height: 30px;
position: absolute;
top: -10px;
right: 105px;
}
<p id="title">• Payment Schedule •</p>
<div id="companyName">
<p id="Logo">Christopher Crawford Const.
</p>
<img src="img/Logo_Crawford1ps.png" id="Logo">
</div>
<form>
<label>I.Downpayment 5/14 <input id="a" type="text"></label>
<label>II.Progress payment end of week2, @15% 5/30<input id="b" type="text"> </label>
<label>III.Progress payment end of week4, @15% 6/13<input id="c" type="text"></label>
<label>IV.Progress payment end of week6, @15% 6/27<input id="d" type="text"></label>
<label>V.Progress payment end of week8, @15% 7/11<input id="e" type="text"></label>
<label id="f">VI.Progress payment end of week10, @15% 7/25<input id="f" type="text"></label>
<label>VII.Progress payment end of week11, @7.5% 8/1<input id="g" type="text"></label>
<label>VIII.Progress payment end of week12, @7.5% 8/8<input id="h" type="text"></label>
<label>IX.Final Payment @10%<input id="i" type="text"></label>
<button id="Total" value="Add Numbers" onclick="myF()">Total</button>
<input type="text" id="result">
</form>