-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
26 lines (22 loc) · 1.13 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
function botonCopiar(){
const copyText = document.getElementById("salida_texto");
copyText.select();
document.execCommand("Copy");
document.getElementById("salida_texto").value=" ";
}
function botonPegar(){
document.getElementById("entrada_texto").value = document.getElementById("salida_texto").value;
document.getElementById("salida_texto").value=" ";
}
function botonEncriptar(){
const encriptar = document.getElementById('entrada_texto').value;
const encriptado = encriptar.replace(/e/gi, 'enter').replace(/i/gi, 'imes').replace(/a/gi, 'ai').replace(/o/gi, 'ober').replace(/u/gi, 'ufat');
document.getElementById("salida_texto").value = encriptado
document.getElementById("entrada_texto").value=" ";
}
function botonDesencriptar(){
const desencriptar= document.getElementById ("entrada_texto").value;
const desencriptado= desencriptar.replace(/ai/gi, 'a').replace(/enter/gi, 'e').replace(/imes/gi, 'i').replace(/ober/gi, 'o').replace(/ufat/gi, 'u');
document.getElementById("salida_texto").value = desencriptado
document.getElementById("entrada_texto").value=" ";
}