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

实现的一个网页版的简易表白墙

实现的一个网页版的表白墙

实现效果

image-20240307134439192

代码截图

image-20240307215605013

相关代码

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title>
</head>
<body><div class="container"><h1>表白墙</h1><P>输入相关信息,点击提交后将会展示在表格中</P><div class="div1"><span>谁:</span><input type="text" class="edit"></div><div class="div1"><span>对谁:</span><input type="text" class="edit"></div><div class="div1"><span>说:</span><input type="text" class="edit"></div><div class="div1"><input type="button" value="提交" class="submit" onclick="Submit()"></div></div>
</body>
<style>* {margin: 0px;padding: 0px;}.container {width: 400px;margin: 0 auto;}h1 {text-align: center;margin-bottom: 20px;margin-top: 40px;}p {text-align: center;color: gray;line-height: 63px;}.div1 {display: flex;justify-content: center;align-items: center;}.edit {margin-bottom: 20px;width: 200px;height: 30px;}span {width: 50px;margin-bottom: 20px;}.submit {background-color: rgb(255, 136, 0);color: white;width: 254px;height: 40px;border: none;border-radius: 5px;}.submit:active {background-color: gray;}</style>
<script>function Submit() {let edits = document.querySelectorAll('.edit')let from  = edits[0].valuelet to  = edits[1].valuelet message = edits[2].valueif(from == "" || to == "" || message == "") {return}let div = document.createElement('div')div.className = 'div1'div.innerHTML =   from + " 对 " + to + "说:" + message let container = document.querySelector('.container')container.appendChild(div)for(i = 0; i < edits.length; i++) {edits[i].value = "";}
}
</script>
</html>
http://www.lryc.cn/news/317740.html

相关文章:

  • 随身WiFi靠谱吗? 看完这篇文章你就懂了?2024随身wifi靠谱品牌推荐
  • mysql的trace追踪SQL工具,进行sql优化
  • docker部署springboot jar包项目
  • 一个八年工作经验老程序员的分享
  • 代码随想录算法训练营第四十三天|动态规划|1049. 最后一块石头的重量 II、494. 目标和、474.一和零
  • vue3+elementPlus:el-table-column表格列动态设置单元格颜色
  • python和shell脚本,每隔五分钟将远端服务器中的文件夹数据下载到跳板机
  • Websocket在Asp.net webApi(.net framework)上的应用
  • App前端开发跨平台框架比较:React Native、Flutter、Xamarin等
  • VR数字展厅在企业中应用的优势有哪些?
  • 【数据库】索引 视图 触发器 分页查询
  • *地宫取宝c++
  • 同态滤波算法详解
  • 财务管理系统报账和挂账分别什么区别!报销又是什么【第三期】
  • 最少刷题数
  • Python刘诗诗
  • 探索ChatGPT在软件架构师工作中的应用
  • pytest--allure报告中添加用例详情
  • 【深度学习笔记】9_5 多尺度目标检测
  • Linux--vim
  • FreeRTOS操作系统学习——中断管理
  • DHCP中继实验(思科)
  • 基于SpringBoot的“心灵治愈交流平台”的设计与实现(源码+数据库+文档+PPT)
  • 【SpringBoot】自定义工具类实现Excel数据新建表存入MySQL数据库
  • Retelling|Facebook1
  • 【2024-03-12】设计模式之模板模式的理解
  • Transformer模型引领NLP革新之路
  • 【Kotlin】运算符函数、解构函数、中缀函数
  • springboot268码头船只货柜管理系统
  • Java面试题11MySQL之执行计划到事务及慢查询