<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Vote!</title>
<script type="text/javascript">
var x = 0;
function countClicks() {
x += 1
document.getElementById( "counting" ).innerHTML = x;
ClickCount++;
return true;
}
</script>
<script type="text/javascript">
var x = 0;
function countClicks1() {
x += 1
document.getElementById( "counting1" ).innerHTML = x;
ClickCount++;
return true;
}
</script>
<script type="text/javascript">
var x = 0;
function countClicks2() {
x += 1
document.getElementById( "counting2" ).innerHTML = x;
ClickCount++;
return true;
}
</script>
</head>
<body>
<div id="chart1">
<ul>
<li>
<img src="../Pictures/BWS + L.A +KUSH/Game.RED_Album_Cover.jpg" alt="red album"><br>
<input type="button" value="VOTE" name="clickOnce" onclick="return countClicks();" />
<div id="counting"></div>
</li>
<li>
<img src="../Pictures/BWS + L.A +KUSH/Game.RED_Album_Cover.jpg" alt="red album"><br>
<input type="button" value="VOTE" name="clickOnce" onclick="return countClicks1();" />
<div id="counting1"></div>
</li>
<li>
<img src="../Pictures/BWS + L.A +KUSH/Game.RED_Album_Cover.jpg" alt="red album"><br>
<input type="button" value="VOTE" name="clickOnce" onclick="return countClicks2();" />
<div id="counting2"></div>
</li>
</ul>
</div>
</body>
</html>
<html> <head> <meta content=text/html; charset=utf-8 http-equiv=Content-Type> <title>Vote!</title> <script type=text/javascript> var x = 0; function
Share
var xis a global variable. Once it has been declared, then your functions will use the same variable. So in bothcountClicksandcountClicks1they are using the same variable.Change the second to use
var x2 = 0