So, i have a button, and a onclick in it. But, for some reason, when the said button is clicked, nothing happens, even though all requirements are met. Here's the code:
function PU2() {
console.log(quarks)
if (quarks > p2_cost - 0.0001) {
quarks = quarks - p2_cost;
p2_cost++
p2_cost = Math.floor(p2_cost * 1.312)
p2_lvl++
console.log(p2_lvl)
}
}
<button onclick="PU2()" id="b2" class="uu3" style="position: absolute;left:40%;border-radius:10px;font-family:fantasy"></button>