1 | <!DOCTYPE html> |
2 | <html lang="es"> |
3 | |
4 | <head> |
5 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="width=device-width"> |
7 | <title>Muestra datos</title> |
8 | </head> |
9 | |
10 | <body onload="descargaDatos()"> |
11 | |
12 | <h1>Muestra datos</h1> |
13 | |
14 | |
15 | |
16 | |
17 | <p> |
18 | <label> |
19 | Nombre |
20 | |
21 | |
22 | <output name="nombre"></output> |
23 | </label> |
24 | </p> |
25 | |
26 | <p> |
27 | <label> |
28 | Apellido |
29 | |
30 | |
31 | <input name="apellido" type="text"> |
32 | </label> |
33 | </p> |
34 | |
35 | <p> |
36 | <label> |
37 | Género |
38 | |
39 | |
40 | <select name="genero"> |
41 | <option value="">Sin selección</option> |
42 | <option value="pop">Pop</option> |
43 | <option value="reg">Reguetón</option> |
44 | </select> |
45 | </label> |
46 | </p> |
47 | |
48 | <p> |
49 | <label> |
50 | Géneración |
51 | |
52 | |
53 | <select name="generacion"> |
54 | <option value="boom">Baby Boom</option> |
55 | <option value="X">X</option> |
56 | <option value="">Sin selección</option> |
57 | <option value="Y">Millenoals</option> |
58 | <option value="Z">Z</option> |
59 | <option value="alfa">Alfa</option> |
60 | </select> |
61 | </label> |
62 | </p> |
63 | |
64 | <p> |
65 | <label> |
66 | Edad |
67 | |
68 | |
69 | <input data-name="edad" type="number"> |
70 | </label> |
71 | </p> |
72 | |
73 | <p> |
74 | <label> |
75 | Número de la suerte |
76 | |
77 | |
78 | <output id="numero"></output> |
79 | </label> |
80 | </p> |
81 | |
82 | <p> |
83 | <label> |
84 | Avance |
85 | |
86 | |
87 | <progress id="avance" max="100"></progress> |
88 | </label> |
89 | </p> |
90 | |
91 | <p> |
92 | <label> |
93 | Capacidad |
94 | |
95 | |
96 | <meter id="capacidad" min="50" max="80"></meter> |
97 | </label> |
98 | </p> |
99 | |
100 | <p> |
101 | <label> |
102 | Temperatura |
103 | |
104 | |
105 | <input id="temperatura" type="range" min="0" max="50"> |
106 | </label> |
107 | </p> |
108 | |
109 | <p> |
110 | <label> |
111 | |
112 | |
113 | |
114 | <input id="aprobado" type="checkbox"> |
115 | Aprobado |
116 | </label> |
117 | </p> |
118 | |
119 | <p> |
120 | <label> |
121 | Gracioso |
122 | |
123 | |
124 | <output id="gracioso"></output> |
125 | </label> |
126 | </p> |
127 | |
128 | <p> |
129 | <label> |
130 | Emplacado |
131 | |
132 | |
133 | <select name="emplacado"> |
134 | <option value="">Sin selección</option> |
135 | <option value="true">Si</option> |
136 | <option value="false">No</option> |
137 | </select> |
138 | </label> |
139 | </p> |
140 | |
141 | <label>Dirección</label> |
142 | |
143 | |
144 | <pre id="direccion"></pre> |
145 | |
146 | <p> |
147 | <label> |
148 | Encabezado |
149 | |
150 | |
151 | <span id="encabezado"></span> |
152 | </label> |
153 | </p> |
154 | |
155 | <p> |
156 | <label> |
157 | Nacimiento |
158 | |
159 | |
160 | |
161 | <input id="nacimiento" type="date"> |
162 | </label> |
163 | </p> |
164 | |
165 | <figure> |
166 | |
167 | |
168 | <img id="imagen1" alt="Imagen 2"> |
169 | <figcaption>Imagen 1</figcaption> |
170 | </figure> |
171 | |
172 | <figure> |
173 | |
174 | |
175 | <img id="imagen2" alt="Imagen 2"> |
176 | <figcaption>Imagen 2</figcaption> |
177 | </figure> |
178 | |
179 | |
180 | |
181 | |
182 | |
183 | |
184 | <fieldset> |
185 | <legend>Pasatiempos</legend> |
186 | <label> |
187 | <input type="checkbox" name="pasatiempos[]" value="fut">Futbol |
188 | </label> |
189 | <label> |
190 | <input type="checkbox" name="pasatiempos[]" value="chess">Ajedrez |
191 | </label> |
192 | <label> |
193 | <input type="checkbox" data-name="pasatiempos[]" value="basket">Basketbol |
194 | </label> |
195 | </fieldset> |
196 | |
197 | |
198 | |
199 | |
200 | |
201 | <fieldset> |
202 | <legend>Madrugador</legend> |
203 | <label><input type="radio" name="madrugador" value="si">Si</label> |
204 | <label><input type="radio" name="madrugador" value="no">No</label> |
205 | </fieldset> |
206 | |
207 | <p> |
208 | <label> |
209 | Patos |
210 | |
211 | |
212 | |
213 | |
214 | |
215 | <select name="patos[]" multiple size="3"> |
216 | <option value="hugo">Hugo</option> |
217 | <option value="paco">Paco</option> |
218 | <option value="luis">Luis</option> |
219 | </select> |
220 | </label> |
221 | </p> |
222 | </body> |
223 | |
224 | <script type="module"> |
225 | |
226 | import { exportaAHtml } from "./lib/js/exportaAHtml.js" |
227 | import { consumeJson } from "./lib/js/consumeJson.js" |
228 | import { muestraObjeto } from "./lib/js/muestraObjeto.js" |
229 | import { muestraError } from "./lib/js/muestraError.js" |
230 | |
231 | async function descargaDatos() { |
232 | try { |
233 | const respuesta = await consumeJson("srv/datos.php") |
234 | muestraObjeto(document, respuesta.body) |
235 | } catch (error) { |
236 | muestraError(error) |
237 | } |
238 | } |
239 | exportaAHtml(descargaDatos) |
240 | |
241 | </script> |
242 | |
243 | </html> |