Alan Russell
New member
I am making a web based text game that features clicking a button that raises text.
This is a script:
<html>
<head>
<script><!--
var Clicks = 0 ;
function AddClick(){
Clicks = Clicks + 13;
document.getElementById('CountedClicks').innerHTML = Clicks + ' Experience Points';
}
// --></script>
</head>
<body>
<span id="CountedClicks">Experience Points</span><br>
This is the button code:
<button style="" onclick="AddClick()">Attack</button>
</body>
</html>
I do this again on the same page, but the script bonds and makes the same object, how can i change this script but still keep the function.
This is a script:
<html>
<head>
<script><!--
var Clicks = 0 ;
function AddClick(){
Clicks = Clicks + 13;
document.getElementById('CountedClicks').innerHTML = Clicks + ' Experience Points';
}
// --></script>
</head>
<body>
<span id="CountedClicks">Experience Points</span><br>
This is the button code:
<button style="" onclick="AddClick()">Attack</button>
</body>
</html>
I do this again on the same page, but the script bonds and makes the same object, how can i change this script but still keep the function.