<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<input type="text" name="message">
<button>提交</button>
<ul></ul>
</body>
<script type="text/javascript">
let message = document.getElementsByName('message')[0];
let button = document.getElementsByTagName('button')[0];
let ul = document.getElementsByTagName('ul')[0];
button.onclick = function(){
let li = document.createElement('li');
li.innerHTML = message.value;
ul.appendChild(li);
message.value="";
}
//1获取发送信息
//2创建信息列表
//3把信息添加到列表中
//4清空发送框内容
</script>
</html>