当前位置: 首页 > news >正文

dreamweaver 电商网站的制作青岛seo网站排名优化

dreamweaver 电商网站的制作,青岛seo网站排名优化,网站怎么做rss,重庆平台网站建设哪里好题目: 要求: 1.表格由专业班级学号1-10号同学的信息组成,包括:学号、姓 名、性别、二级学院、班级、专业、辅导员; 2.表格的奇数行字体为黑色,底色为白色;偶数行字体为白色,底 色为黑…

题目:
要求:
1.表格由专业班级学号1-10号同学的信息组成,包括:学号、姓 名、性别、二级学院、班级、专业、辅导员;
2.表格的奇数行字体为黑色,底色为白色;偶数行字体为白色,底 色为黑色;
3.表格的每一行后有一个删除按钮,点击后会跳出提示弹窗,确认后删除该行的内容,并且删除后上述的颜色规律保持不变:
4.表格的右上方有一个添加按钮,点击后跳出一个表单弹窗,可以填加新的学生的信息。

要点:(原理)

  1. 通过.value获取表单内容,再用innerHTML和添加节点,新增到表单上。
  2. 通过获取删除按钮,绑定事件,进行remove删除节点,不要忘记把新增的内容也获取过来
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>*{margin: 0;padding: 0;}/* a{color: rgb(247, 4, 4);display: inline-block;} */table {border-collapse: collapse;width: 800px;margin: 0 auto;border-spacing: 20px;text-align: center;padding: 10px;}.add {cursor: pointer;}a {color: pink;display: inline-block;}tbody tr:nth-child(odd) {background-color: black;color: white;}tbody tr:nth-child(even) {background-color: white;color: black;}thead tr:nth-child(1) {background-color: greenyellow;color: black;}tr {height: 40px;}.popup {display: none;background-color: whitesmoke;border-radius: 10px;width: 300px;height: 350px;position: absolute;top: 0px;left: 40%;}</style>
</head>
<body><table border="1"><thead><tr><th>学号</th><th>姓名</th><th>性别</th><th>二级学院</th><th>班级</th><th>专业</th><th>辅导员</th><th class="add"><a href="#">添加</a></th></tr></thead><tbody><tr><td>24250101</td><td>小蓝</td><td>女</td><td>计算机专业</td><td>一班</td><td>物联网专业</td><td>魔仙女王</td>  <td><a href="#" class="del">删除</a></td></tr><tr><td>24250102</td><td>游乐王子</td><td>男</td><td>计算机专业</td><td>三班</td><td>软件工程</td><td>魔仙女王</td>  <td><a href="#" class="del">删除</a></td></tr><tr><td>24250103</td><td>玲珑</td><td>女</td><td>计算机专业</td><td>二班</td><td>软件工程</td><td>魔仙女王</td>  <td><a href="#" class="del">删除</a></td></tr><tr><td>24250104</td><td>严莉莉</td><td>女</td><td>计算机专业</td><td>三班</td><td>软件工程</td><td>魔仙女王</td>  <td><a href="#" class="del">删除</a></td></tr><tr><td>24250105</td><td>美琪</td><td>女</td><td>计算机专业</td><td>三班</td><td>物联网工程</td><td>魔仙女王</td>  <td><a href="#" class="del">删除</a></td></tr><tr><td>24250106</td><td>美雪</td><td>女</td><td>计算机专业</td><td>三班</td><td>物联网工程</td><td>魔仙女王</td>  <td><a href="#" class="del">删除</a></td></tr><tr><td>24250107</td><td>小月</td><td>女</td><td>计算机专业</td><td>三班</td><td>软件工程</td><td>魔仙女王</td>  <td><a href="#" class="del">删除</a></td></tr><tr><td>24250108</td><td>石小龙</td><td>男</td><td>计算机专业</td><td>三班</td><td>软件工程</td><td>学校老师</td>  <td><a href="#" class="del">删除</a></td></tr><tr><td>24250109</td><td>方珍妮</td><td>女</td><td>计算机专业</td><td>三班</td><td>软件工程</td><td>学校老师</td>  <td><a href="#" class="del">删除</a></td></tr><tr><td>24250110</td><td>魔仙小千</td><td>女</td><td>计算机专业</td><td>三班</td><td>软件工程</td><td>魔仙女王</td>  <td><a href="#" class="del">删除</a></td></tr></tbody></table><!-- 添加表单弹出框 --><div class="popup" id="addPopup"><div class="popup-content"><!-- <span class="close" id="closeAddPopup">&times;</span> --><form id="addForm"><label for="studentId">学号:</label><input type="text" id="studentId" name="studentId"><br><br><label for="name">姓名:</label><input type="text" id="name" name="name"><br><br><label for="gender">性别:</label><select id="gender" name="gender"><option value="男">男</option><option value="女">女</option></select><br><br><label for="college">二级学院:</label><input type="text" id="college" name="college"><br><br><label for="class">班级:</label><input type="text" id="class" name="class"><br><br><label for="major">专业:</label><input type="text" id="major" name="major"><br><br><label for="counselor">辅导员:</label><input type="text" id="counselor" name="counselor"><br><br><input type="submit" value="提交" class="ok"></form></div></div> 
</body><script>const add = document.querySelector('.add')const popUp = document.querySelector('.popup')const addForm = document.querySelector('#addForm')add.addEventListener('click',function() {popUp.style.display = 'block';})addForm.addEventListener('submit',function(e) {e.preventDefault()const studentId = document.querySelector('#studentId').valueconst name = document.querySelector('#name').valueconst gender = document.querySelector('#gender').valueconst college = document.querySelector('#college').valueconst Class = document.querySelector('#class').valueconst major = document.querySelector('#major').valueconst counselor = document.querySelector('#counselor').valueconst tableBody = document.querySelector('tbody')const newText = document.createElement('tr')newText.innerHTML = `<td>${studentId}</td><td>${name}</td><td>${gender}</td><td>${college}</td><td>${Class}</td><td>${major}</td><td>${counselor}</td><td><a href="#" class="del">删除</a></td>`popUp.style.display = 'none';tableBody.appendChild(newText)const dels = document.querySelectorAll('.del')dels.forEach(function(button){button.addEventListener('click',function(e) {e.preventDefault()if(confirm('你确定要删除吗?')) {let All = this.parentNode.parentNodeAll.parentNode.removeChild(All)}})})})</script>
</html>

视频演示:

动态表格

http://www.wangmingla.cn/news/120363.html

相关文章:

  • 东莞品牌网站建设报价引擎搜索下载
  • 做拼团网站搜索引擎营销成功案例
  • 重庆网站开发企业极速建站网站模板
  • 北京门头沟住房和城乡建设委员会网站刘雯每日资讯
  • 网站浏览器兼容性测试百度官方推广平台
  • 青岛网站如何制作web网站设计
  • 一个专门做海鲜的网站上海网络推广渠道
  • 做网站百度收费吗搜狗官网
  • 宁波建设工程主管部门网站跨境电商培训机构哪个靠谱
  • 网站排名查询系统上海牛巨微网络科技有限公司
  • 杭州学校网站开发苏州seo报价
  • 怎么做58网站吊车网推广普通话绘画
  • txt怎么做网站淮北seo排名
  • 郑州网站制作价格互联网营销成功案例
  • java做直播网站如何网站推广
  • 网站建设公司中广告设计自学教程
  • 企业网站优化怎么做如何做seo搜索优化
  • wordpress最新版本下载津seo快速排名
  • 设计与制作网站商丘seo
  • 零基础制作公司网站教程百度知道一下首页
  • 河北省网站建设广告联盟平台入口
  • 摄影作品网站风景苏州吴中区seo关键词优化排名
  • 公司怎么样做网站外贸快车
  • 网站 毕业设计代做化妆品软文推广范文
  • 外贸大型门户网站建设云南网络推广seo代理公司
  • 大庆网站建设优化网站收录怎么弄
  • 怎么找做企业网站的发表文章的平台有哪些
  • 做网站需要域名和什么seo网站推广杭州
  • 网站建设免费代理360站长平台
  • 郑州主动营销网站苏州百度快速排名优化