Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
How to pull a YouTube video title using the video id with vanilla js?

Using the method below, I am able to pull in a YouTube video's thumbnail.

Is there a similar method to pulling in a YouTube video's title as well?

(function playYouTube() {
  let YouTubeContainers = document.querySelectorAll(".embed-youtube");
  for (let i = 0; i < YouTubeContainers.length; i++) {
    let container = YouTubeContainers[i];
    let imageSource =
      "https://img.youtube.com/vi/" +
      container.dataset.videoId +
      "/sddefault.jpg";
    
    let image = new Image();
    image.src = imageSource;
    image.addEventListener("load", function () {
      container.appendChild(image);
    });    
  }
})();
<div class="embed-youtube" data-video-id="eX2qFMC8cFo"></div>

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda