Add input element and copy input on button click.
Clean up JS.