-
Notifications
You must be signed in to change notification settings - Fork 1
/
entry.html
40 lines (32 loc) · 1.03 KB
/
entry.html
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
36
37
38
39
40
<!DOCTYPE html>
<html lang="pt-br">
<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>Chat</title>
</head>
<body>
<section id="login-menu">
<h2>Entrada</h2>
<input type="text" id="name" placeholder="Entre com o nome">
<input type="text" id="room" placeholder="Entre com o nome da sala">
<button id="btnLogin">Entrar</button>
</section>
<section id="chat" style="display:None">
chat
</section>
<script type="text/javascript">
var btnLogin = document.getElementById("btnLogin");
btnLogin.addEventListener("click", function(event) {
var name = document.getElementById("name").value;
var room = document.getElementById("room").value;
console.log(name);
var loginMenu = document.getElementById("login-menu");
var chat = document.getElementById("chat");
loginMenu.style.display = "None";
chat.style.display = "block";
});
</script>
</body>
</html>