Soy principiante en codificación. Intenté importar la etiqueta h1, así que utilicé la función document.querySelector. Y declaro la variable 'nombre', pero sucede un error. ¿Por qué sucede el error y cómo solucionarlo? Puño, esto es códigos
<!DOCTYPE html> <html> <head> <meta charset = "utf-8"> <title>Test</title> <link rel = "stylesheet" href = "style.css"> </head> <body> <div class = "title"> <h1>Grab me!</h1> </div> <script type = "text/javascript" src = "script.js"></script> </body> </html> const name = document.querySelector(".title:first-child"); console.dir(name);es un error(?)
const name: void @deprecated 'name' is deprecated.ts(6385) lib.dom.d.ts(17177, 5): The declaration was marked as deprecated here.Busqué en Google pero no pude encontrar una respuesta útil 😩 (Perdón por mi pésimo inglés)