// Wipe the content from the element.
element.setTextContent("");
// Attach the temporary input box.
element.appendChild(input);
input.focus();
input.select();
// If we hit enter, commit the action.
input.addEventListener(Event.KEYUP, keyListener, false);