聊天信息的生成

Original 2019-04-30 11:04:53 291
abstract:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>机器人聊天窗口</title></head><body> <input type="

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>机器人聊天窗口</title>
</head>
<body>
 <input type="text" name="info">
 <button>提交</button>
 <ul>
  
 </ul>
 <script type="text/javascript">

  let input = document.getElementsByName('info')[0];
  let button = document.getElementsByTagName('button')[0];
  let ul = document.getElementsByTagName('ul')[0];

  button.onclick = function() {
   let li = document.createElement('li'); 
   li.innerHTML = input.value; 
   ul.appendChild(li); 
         input.value = ''; 
  };
 </script>
</body>
</html>

Correcting teacher:查无此人Correction time:2019-05-05 09:44:39
Teacher's summary:完成的不错。聊天框功能比较繁琐。要多考虑考虑功能。继续加油。

Release Notes

Popular Entries