I am making a website that has buttons that should multiply vales, but I am having trouble.
The first button adds one to the number at the bottom, the second button multiplies the amount that's added by 2, and the third one should multiply the multiplier, but for some reason it doesn't work. It wont update the numbers or anything, so I dont know if its a typo or wrong syntax or somthing.
let numy = 0
increment = 1
multy = 2
multym = 2
function changeColor() {
window.alert("downloading virus");
}
function adNum() {
numy += increment
document.getElementById("num").innerHTML = numy;
}
function multiply() {
increment *= multy
document.getElementById("earn").innerHTML = "press for earn " + increment;
}
function multy() {
multy *= multym
document.getElementById("multiplym").innerHTML = "multiply asmdfmasdfams by " + multym;
}
body {
background-color: powderblue;
}
body {
background-image: url("bigboiwater.jpg");
}
h1,
h2,
h3,
h4,
h5 {
color: red;
}
img {
max-width: 100%;
max-height: 100%;
}
.water {
height: 20px;
cursor: pointer;
margin: 0 auto;
}
#earn {}
#mulity {}
#multym
}
{}
.ih {
left: 1px;
width: 100px
}
.button {
margin: 0 auto;
}
#num {
font-size: 50;
color: pink;
}
<div class="water" ;><button onclick="changeColor()" ;><img src="Click-Here-PNG-Images.png"></button> </div>
</div>
<div>
<button onclick="adNum()" class="button">
<p id="earn">press for earn 1</p>
</button>
<button onclick="multiply()" class="button">
<p id="multiply">multiply earn by 2</p>
</button>
<button onclick="multy()" class="button">
<p id="multiplym">multiply multiply by 2</p>
</button>
</div>
<p id="num">hi</p>
<div style="background-color:pink"><label for="Name">Whats your problem:</label><input type="text" id="Name" name="Name" placeholder="I am kinda stupid"></div>