Borrador.html
1.38 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
<html>
<body>
<input type="number" id="CantBotones">
<button onclick="AgregarTabs()">Generar Tabs</button>
<section id="BotonesContainer" >
</section>
</body>
<script>
function AgregarTabs() {
let m = document.getElementById("CantBotones").value;
let n;
for (n = 0; n < m; n++) {
let padre = document.getElementById("BotonesContainer");
let boton = document.createElement("Button");
padre.appendChild(boton);
boton.setAttribute("id", "Boton" + n);
boton.setAttribute("class", "Botones");
boton.addEventListener("click", HabilitarTab);
boton.style.width = ((100-(0.2*m))/ m) + "%";
}
}
function HabilitarTab(){
}
</script>
<style>
#BotonesContainer {
width: 100%;
height: 95%;
}
.Botones {
border-radius: 5px 5px 0px 0px;
background-color: grey;
border:none;
height: 5%;
margin: 0.1%;
}
.Botones:active{
background-color: whitesmoke;
border-bottom: none;
height: 6%;
border: 1px solid rgb(189, 189, 189);
border-bottom: none;
}
.Botones:hover{
background-color: rgb(53,53,53), 0.5;
}
</style>
</html>