Hi,
I'm looking for a button counter that once the button is pressed the count goes up by 1.
I have this what I came up with
It's simple but I want it to do is save the count plus the button to be on a seprate page to the count it self if possible?
Thanks
I'm looking for a button counter that once the button is pressed the count goes up by 1.
I have this what I came up with
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
var count = 0;
function countClicks() {
count = count + 1;
document.getElementById("p2").innerHTML = count;
}
</script>
</head>
<p style="text-align: center"><img onclick="javascript:countClicks();" src="button.png" alt="alt text" /></p>
<body>
<p style="text-align: center; font-size: 72px" id="p2">0</p>
</body>
</html>
Thanks