In Mobile Safari (5.1.1), if an HTML input has focus and is re-parented in the DOM, it loses focus. And because of this related issue: Mobile Safari Autofocus text field - it is not possible to programmatically give the input focus again if it was previously focused.
JS Fiddle of the re-parenting issue: http://jsfiddle.net/Ex7j7/2/
I have settled on accepting this re-parent / focus loss issue. Unless anyone can edit this JS fiddle to prove otherwise.