abstract:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>DOM實戰(zhàn):模擬智能在線客服系統(tǒng)</title> <style type="text/css"> &n
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>DOM實戰(zhàn):模擬智能在線客服系統(tǒng)</title> <style type="text/css"> div:nth-child(1){ width: 450px; height: 650px; background-color: lightskyblue; color: #333; box-shadow: 2px 2px 2px $808080; } h2 { text-align: center; margin-bottom: -10px; } div:nth-child(2){ width: 400px; height: 500px; border: 4px double green; background: #efefef; margin: 20px auto 10px; } ul { list-style-type:none; line-height: 2em; overflow:hidden; padding: 15px; } table{ width: 90%; height: 80px; margin: auto; } textarea{ border:none; resize:none; background-color: lightyellow; } button{ width: 60px; height: 40px; background-color: seagreen; color:white; border: none; } button:hover{ cursor: pointer; background-color:orange; } </style> </head> <body> <div> <h2>在線客服</h2> <div> <ul> <li></li> </ul> </div> <table> <tr> <td><textarea name="text" cols="50" rows="4"></textarea></td> <td><button type="button">發(fā)送</button></td> </tr> </table> </div> </body> <script type="text/javascript"> //獲取到頁面中的相關元素 let btn = document.getElementsByTagName('button')[0]; let text = document.getElementsByName(text)[0]; let list = document.getElementsByTagName('ul')[0]; let sum = 0; //計數(shù)器 </script> </html>
Correcting teacher:天蓬老師Correction time:2018-12-31 22:34:59
Teacher's summary:let sum = 0; //計數(shù)器, 這里為什么要用let , 用var 是否可以呢?