-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
38 lines (34 loc) · 1.09 KB
/
app.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
// Funcion de encriptar
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-salida").value = textoCifrado;
document.querySelector("#input-texto").value;
}
var boton1 = document.querySelector("#btn-encriptar");
boton1.onclick = encriptar;
// Funcion de desencriptar
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-salida").value = textoCifrado;
document.querySelector("#input-texto").value;
}
var boton1 = document.querySelector("#btn-desencriptar");
boton1.onclick = desencriptar;
// Funcion de copiar
function copiarTexto() {
var copyText = document.getElementById("msg");
copyText.Select;
navigator.clipboard.writeText(copyText.value);
}