Skip to content

Instantly share code, notes, and snippets.

@JavaScript-Packer
Created December 18, 2015 10:22
Show Gist options
  • Select an option

  • Save JavaScript-Packer/ac314caffc28ab0be512 to your computer and use it in GitHub Desktop.

Select an option

Save JavaScript-Packer/ac314caffc28ab0be512 to your computer and use it in GitHub Desktop.
Character counter I threw together so I can see exactly how many chars are used in a chunk of text data
<head><title>Character Counter</title></head><body onclick="whak();">
<h1><a href="http://www.whak.ca">WHAK.ca</a>'s Character Counter</h1>
<textarea onkeyup="whak();" oninput="whak();" onchange="whak();" onfocus="whak();" onscroll="whak();" onclick="whak();" onkeydown="whak();"
id="whak" width="728" height="450" ondblclick="whak();" style="width:728px;height:300px"
placeholder="Type here to find out how many characters are used.&#10;&#10;You can also paste a clump of text in this box.&#10;&#10;www.ScriptCompress.com"
onmouseover="whak();this.select()"></textarea>
<h1 id="count"></h1>
<script>
function whak() {
function n(n) {
return n = new Date(), n.toISOString();
}
document.getElementById("count").innerHTML = document.getElementById("whak").value.length + " characters! " + n();
}
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment