-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.html
More file actions
35 lines (30 loc) · 882 Bytes
/
chat.html
File metadata and controls
35 lines (30 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!doctype html>
<html>
<head>
<title>Chat</title>
<script>
function send(){
var msgbar = document.getElementById("user-msg-bar");
var chatbox = document.getElementById("chatbox");
br = document.createElement("br");
chatbox.append("You: " + msgbar.value + "\n");
chatbox.appendChild(br);
if (msgbar.value.length == 0) {
chatbox.append("please type something");
chatbox.appendChild(br);
}
}
function reset() {
var msgbar = document.getElementById("box").value = "";
}
</script>
</head>
<body>
<div id="chat">
<div id="chatbox" readonly></div><br>
<div id="toolbar">
<input id="user-msg-bar" contenteditable><button id="Send" onclick="send(); reset();" title="Click To Send"><h5>Send</h5></button>
</div>
</div>
</body>
</html>