Automatically Select-All When Clicking On A Content Editable Element

Overview

I'm working on a tool to make ascii art. One feature I'm after is the ability to auto select a character when I click on it. This is the code I'm using for that.

Example HTML

Here's the example along with the HTML that makes it

Draw the chart
Fasten two pins

The Script

And this is the function that makes things happen:

References