Skip to content

Instantly share code, notes, and snippets.

@elialejandro
Created January 5, 2014 00:45
Show Gist options
  • Save elialejandro/8262828 to your computer and use it in GitHub Desktop.
Save elialejandro/8262828 to your computer and use it in GitHub Desktop.
Contador de clicks
<html>
<head>
<title>Contador de clicks</title>
<script>
var i = 0
function clickLink() {
i++;
if (i == 1) {
document.getElementById("clicks").innerHTML = i;
}
else
{
document.getElementById("clicks").innerHTML = i;
}
}
function Reset() {
i = 0;
document.getElementById("clicks").innerHTML = i;
}
</script>
</head>
<body>
<a href="javascript:clickLink();">Click aquí</a>
<p>Clicks <span id="clicks">0</span></p>
<a href="javascript:Reset();">Reset</a>
</body>
</html>
@Juanmanuelgarxia
Copy link

Serote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment