This seems to be a bit problematic, as it's possible to have multiple `<input>`s on the page at the same time. I'd change it to add the input to the HTML and move it in place when needed.