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

200
Vistas
How to get specific element inside of element stored in variable?

I am looking for way to select element inside of already located element in variable. For example I have selected a container:

let productAttachedFilesModal = document.getElementById('modal_more_information');

I know, that inside are array of a elements, which I want to select as well. Which method should I use? in jQuery there are method find(). So I need the analog for JS. Or I need to use DOM method again? Like this:

let listOfLinks= document.getElementById('modal_more_information > a');

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

You can just query that stored DOM reference:

let productAttachedFilesModal = document.getElementById('modal_more_information');

// Query the stored DOM element for all descendent anchors
let childAnchors = productAttachedFilesModal.querySelectorAll("a");
about 4 years ago · Juan Pablo Isaza Denunciar

0

You should use productAttachedFilesModal.children to get its children, which is the elements inside. It will get you an array of HTML elements.

about 4 years ago · Juan Pablo Isaza Denunciar

0

There are several ways:

let anchors = productAttachedFilesModal.getElementsByTagName("a");

let anchors = document.querySelectorAll("#modal_more_information > a")

let anchors = productAttachedFilesModal.querySelectorAll("a");
about 4 years ago · Juan Pablo Isaza Denunciar
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