JS
by IreneQiu
HTML
<h1>成衣批發工廠下單系統</h1>
<label for="name" class=name><span>姓名:</span>
<input type="text" id="name" placeholder="Irene" >
</label>
<div class=button class="name">
<button onclick="fun1()">我要訂購</button>
<button onclick="fun2()">認識工廠</button>
</div>
CSS
*{
box-sizing: border-box;
margin:0;
font-family:Microsoft JhengHei ;
}
h1{
margin:20px;
text-align:center;
padding:10px;
}
.name{
display:flex;
justify-content:center;
margin-bottom:10px;
}
.name >input{
border:none;
width:150px;
border-radius:5px;
background-color:lightgrey;
outline:none;
}
.name >input:hover{
outline:2px solid orange;
}
span{
margin-right:5px;
}
.button{
display:flex;
justify-content:space-evenly;
}
.button >button{
padding:10px;
font-size:16px;
border:none;
border-radius:5px;
background-color:orange;
margin-top:10px;
box-shadow:2px 2px 2px #333;
}
.button >button:hover{
opacity: 0.7;
cursor:pointer;
transform: scale(1.1);
}
JavaScript
function fun1()
{
var one=document.getElementById('name').value;
var two="您好!謝謝您對我們的衣服有興趣!請致電 0987-654-321,會有專人提供您報價!"
alert(one+two)
}
function fun2(){
alert('我們工廠位於新北市,通過國際 ISO9001 認證,品質讓您放心!');
}