Can anyone help me? I am trying to get it to call the click() function when you click the button but nothing happens. The alerts are for testing purposes, and the js will be exported to an external js when I can get it working. Thanks =)
<!DOCTYPE html />
<html>
<head>
<title>Idle Numbers</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head>
<body>
<h1>Idle Numbers</h1>
<p>Number Bank: <span id="numberBank">0</span> | Numbers per Second: <span id="NpS">0</span> | Numbers per Click: <span id="NpC">1</span></p>
<button onclick="click()">Click me</button>
<table id="shop">
<tr>
<th colspan="4">Shop</th>
</tr>
<tr>
<td><p>Ones Place <button onclick="onesPurchase" id="buyOnes">25</button></p></td>
<td><p>Tens Place <button onclick="tensPurchase" value="100" id="buyTens">100</button></p></td>
<td><p>Hundreds Place <button onclick="hundredsPurchase" id="buyHundres">250</button></p></td>
<td><p>Thousands Place <button onclick="ThousandsPurchase" id="buyThousands">2500</button></p></td>
</tr>
</table>
<script type="text/javascript">
var nB, NpS, onesValue, tensValue, hundredsValue, thousandsValue;
var NpC = 1;
function click(){
alert("numberBank");
numberBank = nB + NpC;
alert("numberBank");
document.getElementById("numberBank").innerHTML = nB;
}
</script>
</body>
</html>