-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
79 lines (43 loc) · 1.96 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//var textoOriginal = document.querySelector("input") ;
var textoOriginal = document.getElementById("meu-input") ;
// var meuclickcrip = document.querySelector("button");
var meuclickcrip = document.getElementById("meu-crip");
//var meuclickdescrip = document.querySelector("button");
var meuclickdescrip = document.getElementById("meu-descrip");
var textoConvertido = document.getElementById("txtstart") ;
var copyTexto = document.getElementById("copytx");
var textoFinal;
var trocada1;
var trocada2;
function capturarTexto (){
console.log(textoOriginal.value);
}
function converterTexto(){
var myFrase = textoOriginal.value;
trocada1 = myFrase.replace(/e/g, 'enter').replace(/i/g, 'imes').replace(/a/g, 'ai').replace(/o/g, 'ober').replace(/u/g, 'ufat');
textoFinal = trocada1;
document.getElementById('txtstart').value= trocada1;
}
function cripParaTexto(){
var myFrase = textoOriginal.value;
trocada2 = myFrase.replace(/enter/g, 'e').replace(/imes/g, 'i').replace(/ai/g, 'a').replace(/ober/g, 'o').replace(/ufat/g, 'u');
textoFinal = trocada2;
console.log(textoFinal);
document.getElementById('txtstart').value= trocada2;
}
function copiarTexto() {
let textoCopiado = document.getElementById("txtstart");
textoCopiado.select();
textoCopiado.setSelectionRange(0, 99999)
document.execCommand("copy");
}
//texte//
meuclickcrip.onclick = function(){
converterTexto();
}
meuclickdescrip.onclick = function(){
cripParaTexto();
}
copyTexto.onclick = function(){
execCopy();
}