JSFiddle - React, Tailwind, and code Playground
HTML
<input type="hello">
<button onclick="move()">Move</button><br>
<iframe>
</iframe>
JavaScript
window.move = function() {
var input = document.querySelector('input');
document.querySelector('iframe').contentDocument.body.appendChild(input);
}