-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
53 lines (39 loc) · 1.25 KB
/
Copy pathscript.js
File metadata and controls
53 lines (39 loc) · 1.25 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
function saludo() {
alert("Hola mundo");
var nombre = prompt("Ingrese su nombre:");
alert("hola " + nombre);
}
function despedida() {
alert("Gracias por visitar la pagina");
}
var inicio = document.getElementsByClassName("link")[0];
inicio.addEventListener("click", function() {
saludo();
});
var segundo = document.getElementsByClassName("link")[1];
segundo.addEventListener("click", function() {
despedida();
});
var selectorEtiqueta = document.getElementById("parrafo");
var selectorClass = document.getElementsByClassName("contenedor");
for(let i = 0; i < selectorClass.length; i ++){
console.log(selectorClass[i].innerHTML);
}
function add_function() {
const creandoElemento = document.createElement("p");
const textnode = document.createTextNode("Este nodo fue creado desde JavaScript");
creandoElemento.appendChild(textnode);
document.getElementById("add").appendChild(creandoElemento);
}
function mostrarMensaje() {
document.getElementById("boxz").style.display="block";
}
function ocultarMensaje() {
document.getElementById("box2").style.display="none";
}
function cambiarFondo() {
document.getElementById("btn1").style.backgroundColor = "blue";
}
function cambiarFont() {
document.getElementById("btn2").innetHTML="Change text"
}