-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
41 lines (36 loc) · 1.15 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
"use strict";
const mensaje = document.getElementById("mensaje");
const mensaje2 = document.getElementById("mensaje2");
const btnEncriptar = document.querySelector(".encriptar");
const btnDesencriptar = document.querySelector(".desencriptar");
const btnCopiar = document.querySelector(".copiar");
let encriptado = 0;
const encriptadoValor = function (valor) {
document.getElementById("mensaje2").value = valor;
};
const encriptar = function () {};
btnEncriptar.addEventListener("click", function () {
encriptado = mensaje.value
.replaceAll("e", "enter")
.replaceAll("i", "imes")
.replaceAll("o", "ober")
.replaceAll("a", "ai")
.replaceAll("u", "ufat");
encriptadoValor(encriptado);
mensaje.value = "";
});
btnDesencriptar.addEventListener("click", function () {
encriptado = mensaje.value
.replaceAll("enter", "e")
.replaceAll("imes", "i")
.replaceAll("ober", "o")
.replaceAll("ai", "a")
.replaceAll("ufat", "u");
encriptadoValor(encriptado);
mensaje.value = "";
});
btnCopiar.addEventListener("click", function () {
navigator.clipboard.writeText(encriptado);
mensaje.value = encriptado;
mensaje2.value = "";
});