我的账户
猩码学苑

专注C++开发菁英教育

亲爱的游客,欢迎!

已有账号,请

如尚未注册?

赵强-20221108-DOM&BOM02

[复制链接]
BlueFlame 发表于 2022-11-8 23:39:58 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
今日所学内容:
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

  </head>
  <body>
    <div id="form">
      <p>姓名:<input type="text" id="name" /></p>
      <p>手机:<input type="text" id="tel" /></p>
      <p>
        密码:<input type="password" id="pwd" /><input
          type="button"
          id="toggleType"
          value="显示密码"
        />
      </p>
      <p>
        性别:<input type="radio" name="sex" id="sex"/><input
          type="radio"
          name="sex" id="sex"
        /><input type="radio" name="sex" id="sex" />保密
      </p>
      <p>
        爱好:<input type="checkbox" class="hob" name="hobs" />打球
        <input type="checkbox" class="hob" name="hobs" />唱歌
        <input type="checkbox" class="hob" name="hobs" />跳舞
        <input type="checkbox" class="hob" name="hobs" />睡觉
        <input type="checkbox" class="hob" name="hobs" />打游戏
        <input type="checkbox" class="hob" name="hobs" />敲代码
      </p>
      <p>简介:<textarea id="desc" cols="30" rows="10"></textarea></p>
      <p>
        <button id="btn">提交</button>
        <!-- <input type="button" id="check" value="单选复选" /> -->
      </p>
    </div>
    <!-- 弹窗--蒙版层 -->
    <div id="cover">
      <div id="msgBox">
        <h4>提示标题</h4>
        <p id="msg">提示成功或失败</p>
        <input type="button" id="closeBtn" value="关闭" />
      </div>
    </div>
    <script>
      //获取dom节点
      const userName = document.querySelector("#name");
      const hobs = document.querySelectorAll(".hob");
      const pwd = document.querySelector("#pwd");
      const tel = document.querySelector("#tel");
      const sex = document.querySelectorAll("#sex");
      const btn = document.querySelector("#btn");
      const desc = document.querySelector("#desc");

      const cover = document.querySelector("#cover");
      const msgBox = document.querySelector("#msgBox");
      const msg = document.querySelector("#msg");
      const closeBtn = document.querySelector("#closeBtn");

      const toggleType = document.querySelector("#toggleType");







    </script>
  </body>
</html>



回复

使用道具 举报

关注0

粉丝0

帖子47

发布主题
大家都在学
课堂讨论
一周热帖排行最近7x24小时热帖
关注我们
专注C++菁英教育

客服电话:18009298968

客服时间:9:00-21:00

猩码学苑 - 专注C++开发菁英教育!( 陕ICP备2025058934号-1 )

版权所有 © 陕西菁英数字科技有限公司 2023-2026