为了账号安全,请及时绑定邮箱和手机立即绑定

为什么重置按钮在给定的 HTML 代码中不起作用?

为什么重置按钮在给定的 HTML 代码中不起作用?

FFIVE 2023-10-10 16:19:14
重置按钮不起作用的表单代码。这是收集学生信息的表格。它使用标签、文本字段、文本区域、单选按钮、复选框、提交按钮、重置按钮等。重置按钮在此代码中不起作用。<!DOCTYPE html><html><head>  <style type="text/css">    label.la {      text-indent: 30px;      color: red;      width: 240px;      display: inline-block;    }  </style>  <style type="text/css">    input.tf {      border-color: green;      border: 2px solid    }  </style>  <style type="text/css">    #b1:hover {      background-color: red;      color: white    }        #b2:hover {      background-color: green;      color: white    }  </style></head><body style="text-align: center">  <h1>Assignment 3</h1>  <from style="display:inline-block;" action="/action_page.php">    <fieldset>      <legend>        <h3>Student Info</h3>      </legend>      <label class="la">First Name:</label>      <input class="tf" type="text" placeholder="Jadon" required>      <br><br>      <label class="la">Last Name:</label>      <input class="tf" type="text" placeholder="Sancho" required>      <br><br>      <label class="la">Date of Birth:</label>      <input class="tf" type="text" placeholder="1/1/1999" required>      <br><br>      <label class="la">Age:</label>      <input class="tf" type="text" placeholder="20" required>      <br><br>      <label class="la" style="padding-right: 30px">Gender:</label>      <input type="radio" name="Male" value="Male">      <label>Male</label>      <input type="radio" name="Female" value="Female">      <label for="Female">Female</label>      <br><br>      <label style="color:red;display:inline;padding-left: 60px;width: 210px;display: inline-block;margin:-top:20px">Address:</label>      <textarea cols="25" rows="3" placeholder="type here..." style="border-color: green;border:2px solid;margin-top: : 50px"></textarea>      <br><br>        }      </script>    </fieldset>  </from></body></html>
查看完整描述

1 回答

?
慕侠2389804

TA贡献1719条经验 获得超6个赞

<!DOCTYPE html>

<html>


<head>

  <style type="text/css">

    label.la {

      text-indent: 30px;

      color: red;

      width: 240px;

      display: inline-block;

    }

  </style>

  <style type="text/css">

    input.tf {

      border-color: green;

      border: 2px solid

    }

  </style>

  <style type="text/css">

    #b1:hover {

      background-color: red;

      color: white

    }

    

    #b2:hover {

      background-color: green;

      color: white

    }

  </style>

</head>


<body style="text-align: center">

  <h1>Assignment 3</h1>

  <form style="display:inline-block;" action="/action_page.php">

    <fieldset>

      <legend>

        <h3>Student Info</h3>

      </legend>

      <label class="la">First Name:</label>

      <input class="tf" type="text" placeholder="Jadon" required>

      <br><br>

      <label class="la">Last Name:</label>

      <input class="tf" type="text" placeholder="Sancho" required>

      <br><br>

      <label class="la">Date of Birth:</label>

      <input class="tf" type="text" placeholder="1/1/1999" required>

      <br><br>

      <label class="la">Age:</label>

      <input class="tf" type="text" placeholder="20" required>

      <br><br>

      <label class="la" style="padding-right: 30px">Gender:</label>

      <input type="radio" name="Male" value="Male">

      <label>Male</label>

      <input type="radio" name="Female" value="Female">

      <label for="Female">Female</label>

      <br><br>

      <label style="color:red;display:inline;padding-left: 60px;width: 210px;display: inline-block;margin:-top:20px">Address:</label>

      <textarea cols="25" rows="3" placeholder="type here..." style="border-color: green;border:2px solid;margin-top: : 50px"></textarea>

      <br><br>

      <label class="la" style="padding-left: 55px">Class:</label>

      <input type="radio" name="Class" value="F.Y">

      <label>F.Y</label>

      <input type="radio" name="Class" value="S.Y">

      <label>S.Y</label>

      <input type="radio" name="Class" value="T.Y">

      <label>T.Y</label>

      <input type="radio" name="Class" value="B.Tech">

      <label>B.Tech</label>

      <br><br>

      <label class="la" style="padding-left: 95px">Area(s) of Interest:</label>

      <input type="checkbox" name="M.L">

      <label for="M.L">M.L</label>

      <input type="checkbox" name="A.I">

      <label for="A.I">A.I</label>

      <input type="checkbox" name="H.P.C">

      <label for="H.P.C">H.P.C</label>

      <input type="checkbox" name="Cyber-Security">

      <label for="Cyber-Security">Cyber-Security</label>

      <br><br>

      <label class="la">E-mail:</label>

      <input class="tf" type="text" placeholder="JSancho07@gmail.com" required>

      <br><br>

      <label class="la">Password:</label>

      <input class="tf" type="Password" placeholder="min 8 characters" required>

      <br><br>

      <input id="b1" type="reset" name="Reset" value="Reset" style="border-color: red;font-size: 20px;border-radius: 15%;margin:10px">

      <input id="b2" type="submit" name="submit" style="border-color: green;font-size: 20px;border-radius: 15%;margin: 10px" onclick="myFunction()">

      <script>

        function myFunction() {

          alert("Submission Successful");

        }

      </script>

    </fieldset>

  </form>

</body>


</html>


查看完整回答
反对 回复 2023-10-10
  • 1 回答
  • 0 关注
  • 46 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信