Hey i need some help, im trying to use javascript to add things like money by clicking a button to call on a function. this is what i can come up with if anyone can lead me in the right direction id apreciate it.
code:
<!DOCTYPE html>
<html>
<body>
<p>Click the button to add money to your wallet.</p>
<button onclick=“myFunction()”>Wallet</button>
<p id=“demo”></p>
<button onclick=“addMoney()”>Add</button>
<p id=“add”></p>
<script>
function myFunction()
{
var $;
var $=5;
document.getElementById(“demo”).innerHTML=$;
}
function addMoney()
{
var $;
var t=$+1;
document.getElementById(“add”).innerHTML=t;
}
</script>
</body>
</html>