本篇文章给大家带来的内容是介绍原生js实现提交评论,显示评论的效果的方法(代码示例) 。有一定的参考价值,有需要的朋友可以参考一下,希望对你们有所帮助。
html>
<meta>
<style>
#box{
width: 900px;
margin: 0 auto;
}
#text{
width: 900px;
height: 400px;
margin: 0 auto;
background-color: #fbe1c8;
margin-top: 60px;
outline: none;
border-radius: 8px;
border:2px solid #e59a56;
overflow: hidden;
}
#tup{
float: right;
display: block;
margin-top: 10px;
margin-left: 20px;
width: 60px;
height: 36px;
background-color: #e69b57;
font-size: 18px;
line-height: 36px;
border-radius: 6px;
text-align: center;
color: #ffffff;
cursor:pointer;
}
#wad{
margin-top: 60px;
width: 880px;
}
#wad p{
font-size: 18px;
line-height: 24px;
border-bottom: 1px dashed #e69b57;
word-wrap: break-word;
}
</style>
<div>
<div></div>
<span>提交</span>
<div></div>
</div>
<script>
let Text = document.getElementById('text'),
Tup = document.getElementById("tup"),
Pl = document.getElementById("wad");
Tup.onclick = function(){
Li = "<p>" + Text.innerHTML + "";
Text.innerHTML = "";
Pl.innerHTML += Li ;
}
</script>
效果图:
使用 extruct 从原始 HTML 中提取机器可读的元数据,以便代理可以在不依赖脆弱的全页解析的情况下对页面进行分类、去重或丰富。它最适合元数据采集工作流,而不适用于爬取整个网站或渲染 JavaScript 密集型页面。











