小工具知识网

当前位置: 首页 > 行业知识 > 实现的一个网页版的简易表白墙

行业知识

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

2026-11-14 12:27:17 来源:互联网转载

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

实现效果

代码截图

index.php/tags-41973.html" >���关代码

            Document            

表白墙

输入相关信息,点击提交后将会展示在表格中

谁: 对谁: 说: * { 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; } .p1 { 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; } function Submit() { let edits = document.querySelectorAll('.edit') let from = edits[0].value let to = edits[1].value let message = edits[2].value if(from == "" || to == "" || message == "") { return } let p = document.createElement('p') p.className = 'p1' p.innerHTML = from + " 对 " + to + "说:" + message let container = document.querySelector('.container') container.appendChild(p) for(i = 0; i

上一篇:Roco下载秘籍,轻松获取,步步为赢!

下一篇:买了家用服务器怎么用?