-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathback.js
30 lines (23 loc) · 1.09 KB
/
back.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
function cript (){
var texto = document.querySelector("#input-texto").value;
var cifrar = 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 = cifrar;
document.querySelector("#input-texto").value;
}
var boton1 = document.querySelector("#btn-criptar");
boton1.onclick = cript;
function descriptar (){
var texto = document.querySelector("#input-texto").value;
var cifrar = 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 = cifrar;
document.querySelector("#input-texto").value;
}
var boton2 = document.querySelector("#btn-descriptar");
boton2.onclick = descriptar;
document.getElementById("btn-copy").onclick = function() {
copytext.textContent = document.getElementById(".text-salida").value;
document.body.appendChild(copytext);
copyTextarea.select();
document.execCommand('btn-copy');
document.body.removeChild(copytext);
}