Replace elements with input fields