-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheliminar_vocal.html
More file actions
72 lines (56 loc) · 2.21 KB
/
eliminar_vocal.html
File metadata and controls
72 lines (56 loc) · 2.21 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Eliminar Vocal</title>
</head>
<body>
<header>
<h1>6. Eliminar Vocal</h1>
<p>Crea una aplicación que contenga un párrafo con mucho texto. Debajo del párrafo debe aparecer un botón por cada vocal. Al pulsar sobre una vocal, esa vocal desaparecerá del texto.</p>
<p><a href="index.html">volver atrás</a></p>
</header>
<main>
<p id="parrafo">Éste es un párrafo de prueba que servirá para probar el funcionamiento de los botones que eliminan las vocales</p>
<button id="a">A</button>
<button id="e">E</button>
<button id="i">I</button>
<button id="o">O</button>
<button id="u">U</button>
<button id="reiniciar">Reiniciar</button>
</main>
<script>
let parrafo = document.getElementById("parrafo");
let a = document.getElementById("a");
let e = document.getElementById("e");
let i = document.getElementById("i");
let o = document.getElementById("o");
let u = document.getElementById("u");
let reiniciar = document.getElementById("reiniciar");
a.addEventListener('click', ()=>{
let as = parrafo.textContent.replace(/[aáàäâ]/gi, "")
parrafo.textContent = as;
})
e.addEventListener('click', ()=>{
let es = parrafo.textContent.replace(/[eéèëê]/gi, "")
parrafo.textContent = es;
})
i.addEventListener('click', ()=>{
let is = parrafo.textContent.replace(/[iíìïî]/gi, "")
parrafo.textContent = is;
})
o.addEventListener('click', ()=>{
let os = parrafo.textContent.replace(/[oóòöô]/gi, "")
parrafo.textContent = os;
})
u.addEventListener('click', ()=>{
let us = parrafo.textContent.replace(/[uúùüû]/gi, "")
parrafo.textContent = us;
})
reiniciar.addEventListener('click', ()=>{
parrafo.textContent = "Éste es un párrafo de prueba que servirá para probar el funcionamiento de los botones que eliminan las vocales"
})
</script>
</body>
</html>