-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03 Editor de texto personalizado.html
More file actions
44 lines (36 loc) · 1.34 KB
/
03 Editor de texto personalizado.html
File metadata and controls
44 lines (36 loc) · 1.34 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
<!DOCTYPE html>
<html lang="en">
<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>03 - Editor de texto personalizado.</title>
</head>
<body>
<textarea id="texto"></textarea><br/>
<button onclick="minusculas()">Converter para minúsculas</button><br/>
<button onclick="maiusculas()">Converter para MAIÚSCULAS</button><br/>
<button onclick="contar_carcteres()">Contagem de caracteres</button><br/>
<button onclick="contar_linhas()">Contagem de linhas</button><br/>
</body>
<script>
function minusculas(){
var texto = document.getElementById("texto").value
document.getElementById("texto").value = texto.toLowerCase()
}
function maiusculas(){
var texto = document.getElementById("texto").value
document.getElementById("texto").value = texto.toUpperCase()
}
function contar_carcteres(){
var texto = document.getElementById("texto").value
document.getElementById("texto").value = texto.length
}
function contar_linhas(){
var texto = document.getElementById("texto").value
texto = texto.split("\n")
var total_linhas = texto.length
document.getElementById("texto").value = total_linhas
}
</script>
</html>