I am trying to move an element inside a form and then change the display to block. I am getting the display to change but can't seem to move it, this is the code I am using
<form action="testsubmit.php">
<div id="placehere">
</div>
<input type="submit" value="submit">
</form>
<div id="input1" style="display:none">
<input type="text" name="test" id="input1">
</div>
<button onclick="test()">Click me</button>
<script>
function test(){
document.getElementById('input1').appendChild(document.getElementById('placehere'));
document.getElementById('input1').style.display = 'block';
}
</script>