<label for="fname">First Name</label>
<input type="text" id="fname" name="firstname" placeholder="Your name.."> //fname textbox
<label for="lname">Last Name</label>
<input type="text" id="lname" name="lastname" placeholder="Your last name..">//lastname textbox
<label for="country">Country</label> //creating list country
<select id="country" name="country">
<option value="australia">Australia</option> //options for the country list
<option value="canada">Canada</option>
<option value="usa">USA</option>
</select>
<label for="subject">Subject</label> //creating subject textbox
<textarea id="subject" name="subject" placeholder="Write something.." style="height:200px"></textarea>
<input type="submit" value="Submit"> /summit button
我想删除我显示的一些信息,并在单击按钮时添加容器和名字、姓氏等。到目前为止,我正在使用
function (ex)myFunction2(){
var myobj = document.getElementById("fname");
myobj.remove();
}
在页面加载时删除它们,但我不知道如何将它们恢复