-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript.js
More file actions
30 lines (26 loc) · 1007 Bytes
/
Copy pathjavascript.js
File metadata and controls
30 lines (26 loc) · 1007 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
function criptografar() {
const textoOriginal = document.getElementById('textoOriginal').value;
const textoCriptografado = textoOriginal
.replace(/e/g, 'enter')
.replace(/i/g, 'imes')
.replace(/a/g, 'ai')
.replace(/o/g, 'ober')
.replace(/u/g, 'ufat');
document.getElementById('textoResultante').value = textoCriptografado;
}
function descriptografar() {
const textoCriptografado = document.getElementById('textoOriginal').value;
const textoDescriptografado = textoCriptografado
.replace(/enter/g, 'e')
.replace(/imes/g, 'i')
.replace(/ai/g, 'a')
.replace(/ober/g, 'o')
.replace(/ufat/g, 'u');
document.getElementById('textoResultante').value = textoDescriptografado;
}
function copiarTexto() {
const textoResultante = document.getElementById('textoResultante');
textoResultante.select();
document.execCommand('copy');
alert('Texto copiado para a área de transferência!');
}