19 June, 2007 6 Comments
One for the coders out there… everyone else: move along!
The code that was closest to what I wanted can be found here which puts the character count in a rather ugly read-only input box (unless you then go to great lengths to style the box to be hidden, but that’s a pain).
A nicer solution is to dynamically change some text on the page via innerHTML. For a complete working example, grab the code below and save to a local file on your computer to play with,
Incidentally, displaying code in a WordPress blog is simple IF you follow these steps…
1. Use the Visual Rich Editor and enter/paste your code
2. Switch to the Code Editor – this rewrites < and > as < and >
3. Wrap the code in <code> and <pre> tags