Use createElement() to create new inputs and set the 'value' of these inputs to the 'value' of the ones whose text you want to copy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity
." Me Myself & Irene
Validate your HTML