-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
41 lines (34 loc) · 1.17 KB
/
script.js
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
function encriptar() {
var texto = document.querySelector("#input-texto").value;
var textoCifrado = texto
.replace(/e/gi, "enter")
.replace(/i/gi, "imes")
.replace(/a/gi, "ai")
.replace(/o/gi, "ober")
.replace(/u/gi, "ufat");
document.querySelector(".text-input-salida").value = textoCifrado;
document.querySelector("#input-texto").value;
}
var boton1 = document.querySelector("#btn-encriptar");
boton1.onclick = encriptar;
function desencriptar() {
var texto = document.querySelector("#input-texto").value;
var textoCifrado = texto
.replace(/enter/gi, "e")
.replace(/imes/gi, "i")
.replace(/ai/gi, "a")
.replace(/ober/gi, "o")
.replace(/ufat/gi, "u");
document.querySelector(".text-input-salida").value = textoCifrado;
document.querySelector("#input-texto").value;
}
var boton2 = document.querySelector("#btn-desencriptar");
boton2.onclick = desencriptar;
function copytext() {
var copyText = document.getElementById("msg");
copyText.select();
copyText.setSelectionRange(0, 99999);
navigator.clipboard.writeText(copyText.value);
}
var boton3 = document.querySelector("#btn-copy");
boton3.onclick = copytext;