完成课程内容完成课程内容

Original 2019-05-03 21:05:39 327
abstract:<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>test</title></head><body><input typ

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>test</title>
</head>
<body>
<input type="text"><button>发送</button>
<ul></ul>
<script>
 function getObj(arg){
   return document.getElementsByTagName(arg)[0];
 }
 var input = getObj("input");
 var button = getObj("button");
 var ul = getObj("ul");

 button.onclick = function(){
   var value = input.value;
   if(value == ""){
     alert("不可以发送空文本");
   }else{
     var li = document.createElement("li");
     li.innerHTML = value;
     ul.appendChild(li);
     input.value = "";
   }
 }
</script>
</body>
</html>

Correcting teacher:查无此人Correction time:2019-05-05 10:33:52
Teacher's summary:完成的不错。后期学习了php,就用php保存和显示聊天数据。继续加油。

Release Notes

Popular Entries