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
Get grandchildren without ID of element with ID

I have a website with many DIV elements without ID. The code of this website is created automatically with JavaScript, I can't change it. To change the z-index of selected elements without ID, I have to address them with JavaScript, with CSS it doesn't work.

How can I address children and grandchildren without ID using JavaScript?

I tried different functions but they do not work yet:

function huhu() {
  var x = document.getElementById("parent-element-with-id");
  x.querySelectorAll("*").style.zIndex = "9999";
}

function huhu() {
  document.querySelectorAll("#39 *").style.zIndex = "9999";
}

function huhu() {
  document.querySelectorAll("#39 > div > div).style.zIndex = "9999";
}

The JavaScript event:

<div onmouseover="huhu()"></div>

The working function:

function huhu() {
  document.getElementById("parent-element-with-id").style.zIndex = "9999";
}

The grandchild DIV without ID I want to address:

<div id="parent-element-with-id">
    <div>
      <div>
      </div>
    </div>
</div>

Besides, I also intend to address all * children and grandchildren. How can I achieve this?

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