abstract:let li = document.createElement('li');li.innerHTML = userComment; //将用户输入的内容添加到新节点中let userPic = '<img src="inc/peter.jpg" width="30" style="border-radius
let li = document.createElement('li');
li.innerHTML = userComment; //将用户输入的内容添加到新节点中
let userPic = '<img src="inc/peter.jpg" width="30" style="border-radius:50%">'; // 设置用户头像
li.innerHTML = userPic + ' ' + userComment; // 将用户头像与用户的聊天内容合并
list.appendChild(li); //发送聊天内容,实际上就是将新节点插入到对话列表中
sum += 1; // 聊天记录自增1
Correcting teacher:查无此人Correction time:2019-07-15 13:06:48
Teacher's summary:代码太简单了,下次把项目截图,或者复制上来。继续加油