HTML 簡單表單 模坂

Hi there,本文章想各位伙子,或是程序員評論一下這個文章,一起吐嘈一下。

 

模版連結如下:

https://raewaq.mimo.run/index.html

HTML段 代码如下:

<!doctype html>
<html lang="en">
<head>
 <title>Form</title>
 <link rel="stylesheet" href="style.css">
</head>
<body>
   <div id="form">
      <center>
         <br>
         <br>
         <br>
         <h1>Apply form</h1>
         <br>
         <label> Name: </label>
         <input type="text" id="name" placeholder="eg: Chan Tai Man">
         <br>
         <label> Age: </label>
         <input type="number" id="age">
         <br>
         <label> What your salary: </label>
         <select>
          <option> --choose your salary-- </option>
           <option> >$2000 </option>
           <option> large than$10000 </option>
           </select>
           <br>
           <button class="btn" onclick="submit()">Submit</button>
          </center>
   </div>
   







 <script src="script.js"></script>
 </body>
</html>


JavaScript 段:

function submit(){
   var name = document.getElementById("name").value;
   var age = document.getElementById("age").value;
   if (name=="" && age=="") {
      alert("Apply fail.");
   }
   else {
      alert("Apply sucess.");
   }
   
}

CSS 模版:

#form {
   border: solid 10px green;
   padding: 14px 15px;
   font-size: 16px;
}
.btn {
   background-color: #00FF00;
   color: white;
   padding: 20px 21px;
   font-size: 21px;
}

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值