Preserve the position of the caret while editing a textarea or input[type=text].