您的位置:首页 > 房产 > 建筑 > 店面门头在线设计网站_潍坊市政府门户网站_seo81_seo关键词排名优化哪好

店面门头在线设计网站_潍坊市政府门户网站_seo81_seo关键词排名优化哪好

2024/10/6 2:08:46 来源:https://blog.csdn.net/Dingyuan0/article/details/142706002  浏览:    关键词:店面门头在线设计网站_潍坊市政府门户网站_seo81_seo关键词排名优化哪好
店面门头在线设计网站_潍坊市政府门户网站_seo81_seo关键词排名优化哪好

文章目录

  • 效果展示
    • 初始画面
    • 提交内容后画面(按键按下)
  • 代码区

效果展示

初始画面

在这里插入图片描述

提交内容后画面(按键按下)

在这里插入图片描述

代码区

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>表白墙</title>
</head>
<style>* {margin: 0px;padding: 0px;}.total {width: 400px;margin: 0px auto; /*上下、左右*/}h1 {text-align: center;padding-bottom: 30px;}p {text-align: center;color: gray;}.div1 {display: flex;justify-content: center; /*水平方向*/align-items: center; /*垂直方向*/padding-top: 5px;}span {width: 80px;height: 30px;}#edit {width: 200px;height: 30px;}.submit {width: 280px;height: 30px;background-color: rgba(248, 236, 7, 0.942);border: none;border-radius: 5px;}.submit:active{background-color: grey;}
</style>
<body><div class="total"><h1>表白墙</h1><p>输入后请点击提交,会将信息显示在表格中</p><div class="div1"><span>谁:</span><input id="edit" class="who" type="text"></div><div class="div1"><span>对谁:</span><input id="edit" class="ofwho" type="text"></div><div class="div1"><span>说什么</span><input id="edit" class="what" type="text"></div><div class="div1"><input class="submit" type="button" value="提交" onclick="submit()"></div></div>
</body>
<script>function submit(){let containDiv = document.querySelectorAll('#edit')console.dir(containDiv)let from = containDiv[0].valuelet to = containDiv[1].valuelet message = containDiv[2].valueconsole.log(from+'对'+to+'说'+message)// 创建divlet nodeDiv = document.createElement('div')nodeDiv.className = 'div1'nodeDiv.innerHTML = from+'对'+to+'说'+messageconsole.log(nodeDiv)// 尾插divlet nodeparent = document.querySelector('.total')nodeparent.appendChild(nodeDiv)}
</script>
</html>

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com