0
我正在創建生日快樂卡,因此我需要將表單中的數據帶到生日卡片頁面,因此如何從第一個div(第一個div是表單)傳輸信息並顯示數據在第二個div中。顯示錶格中的數據
<!DOCTYPE html>
<html>
<body>
<script>
function myfunction(){
var divelement = document.getElementById(id);
if(divelement.style.display === 'none')
divelement.style.display = 'block';
else
divelement.style.display = 'none';
}
</script>
<div>
<style>
form{
text-align: center;
font-size: 20px;
}
</style>
<div id="form" style="display:block;" >
<form name = "form" id = "form">
First name:<br> <br>
<input type="text" name="firstname">
<br><br>
Last name:<br><br>
<input type="text" name="lastname" ><br><br>
Message:<br><br>
<input type="text" name="message" >
<br><br>
<button onclick="myfunction('form')">Click me !!!!</button>
</form>
</div>
</div>
<div>
<div class='card'>
<div class='front face'>
<img src= images/birthday.gif/>
</div>
<div class="back face">
<img src= images/birthday1.gif/>
</div>
</div>
</body>