-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext.html
More file actions
45 lines (42 loc) · 1.12 KB
/
text.html
File metadata and controls
45 lines (42 loc) · 1.12 KB
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
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Live Text Display</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 50px;
}
input[type="text"] {
width: 300px;
padding: 8px;
font-size: 16px;
}
#b {
width: 100%;
margin-top: 15px;
padding: 15px;
border: 2px solid #ccc;
min-height: 5px;
font-size: 18px;
color: rgb(11, 124, 216);
}
</style>
</head>
<body>
<h2>Live Text </h2>
<input type="text" id="1" placeholder="Type something...">
<div id="b">Your text will appear here...</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
$(document).ready(function(){
$("#1").keyup(function(){
let text = $(this).val();
$("#b").text(text);
});
});
</script>
</body>
</html>