聊天信息的生成原理

Original 2019-04-22 18:01:28 259
abstract:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">&

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>Document</title>

</head>

<body>

<input type="text" name="info">

<button style="color:coral;">提交</button>

<ul></ul>

<script>

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.insertBefore(li,null);

input.value = '';

}

</script>

</body>

</html>


Correcting teacher:查无此人Correction time:2019-04-23 13:43:42
Teacher's summary:完成的不错。下次最好有备注,这样看代码会清楚些。继续加油。

Release Notes

Popular Entries