Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="es-ES">
- <head>
- <meta charset="utf-8">
- <title>Grupo de música - Queen</title>
- <script>
- // encabezados
- function enc() {
- var enc = document.querySelectorAll("h1,h2").length;
- alert(enc);
- console.log(alert);
- }
- // filas
- function filas() {
- var filas = document.getElementById("exitos").getElementsByTagName("tr").length;
- alert(filas);
- }
- // segundo h2
- function enc2() {
- var enc2 = document.getElementsByTagName("h2");
- alert(enc2[1].innerHTML);
- }
- // hipervinculo
- function hiper() {
- var hiper = document.getElementsByTagName("a")[0].href;
- alert(hiper);
- }
- </script>
- </head>
- <body>
- <h1>Queen</h1>
- <p>Banda británica de rock formada en 1970 en Londres.</p>
- <img src="imagenes/queen.jpg" width="400" height="200" alt="Fotografía de los componentes del grupo Queen.">
- <h2 class="h">Integrantes del grupo</h2>
- <ul>
- <li>Brian May</li>
- <li>Freddie Mercury</li>
- <li>John Deacon</li>
- <li>Roger Taylor</li>
- </ul>
- <h2 class="h">Discografía</h2>
- <table id="exitos">
- <caption>Grandes éxitos de Queen</caption>
- <thead>
- <tr>
- <th>Año</th>
- <th>Disco</th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td>"A Kind of Magic" fue el álbum más exitoso.</td>
- </tr>
- </tfoot>
- <tbody>
- <tr>
- <td>1975</td>
- <td>A Night at the Opera</td>
- </tr>
- <tr>
- <td>1986</td>
- <td>A Kind of Magic</td>
- </tr>
- <tr>
- <td>1989</td>
- <td>The Miracle</td>
- </tr>
- </tbody>
- </table>
- <h2 class="h">Sitio web oficial</h2>
- <a href="http://www.queenonline.com/" target="_blank">www.queenonline.com</a>
- <hr>
- <!-- añado botones -->
- <input type="submit" value="Encabezados" onclick="enc()"/>
- <input type="submit" value="Filas" onclick="filas()"/>
- <input type="submit" value="sgundo h2" onclick="enc2()"/>
- <input type="submit" value="hipervinculo" onclick="hiper()"/>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement