document.getElementById("mydiv").innerHTML = "";
<form onclick="scroll()" > <input type='text' id='otpravit2' name='otpravit' > <input type='button' id='button2' value='Отправить'> </form>