We could also achieve it with single tape Turing machines, but with js in the parent document it takes just a few lines and is practical to do.