Skip to content

Instantly share code, notes, and snippets.

@evgeniy1204
Created August 9, 2018 11:17
Show Gist options
  • Save evgeniy1204/57b79086e50e648f0e24e87058376171 to your computer and use it in GitHub Desktop.
Save evgeniy1204/57b79086e50e648f0e24e87058376171 to your computer and use it in GitHub Desktop.
<button id="but" onclick="butClick();">0</button>
<script type="text/javascript">
function butClick() {
var count = parseInt(document.getElementsByTagName('button')[0].innerHTML);
count+=1;
document.getElementsByTagName('button')[0].innerHTML = count;
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment