亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

模擬只能客服系統(tǒng)(一)

原創(chuàng) 2019-03-03 18:36:06 274
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>DOM實(shí)戰(zhàn):模擬在線客服系統(tǒng)</title> <style> div:nth-child(1){width
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DOM實(shí)戰(zhàn):模擬在線客服系統(tǒng)</title>
<style>
div:nth-child(1){width: 450px;height: 650px;background: lightskyblue;
margin: 30px auto;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:0;resize: none;background: lightyellow;}
button{width: 60px;height: 40px;background: seagreen;color: white;border:0;}
button:hover{cursor: pointer;background: 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 align="left"><button type="button">發(fā)送</button></td>
</tr>
</table>
</div>
</body>
</html>
<script>
// 獲取到頁面中相關(guān)元素
let btn = document.getElementsByTagName('button')[0];
let text = document.getElementsByName('text')[0];
let lists = document.getElementsByTagName('ul')[0];
let sum = 0; // 計(jì)數(shù)器初始化

// 添加點(diǎn)擊事件,獲取用戶信息并發(fā)送到窗口
btn.onclick = function(){
alert(text.value)
}
</script>


批改老師:韋小寶批改時(shí)間:2019-03-04 09:13:12
老師總結(jié):寫的還是很不錯的 把前面的樣式部分相當(dāng)于復(fù)習(xí)了一遍 沒事要記得多去練習(xí) 繼續(xù)加油吧!

發(fā)佈手記

熱門詞條