Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
¿Cómo puedo lograr la itinerancia de pestañas en un elemento que está dentro de un elemento principal?

Estoy usando la función tabRoving en la imagen de vista de árbol que se encuentra en la parte final del nodo principal. Quiero configurar el último elemento seleccionado con tabindex=0 y el resto de ellos en tabindex=-1 con la identificación de imagen específica.

Aquí está el código que he hecho hasta ahora:

 const tabRoving = (element) => { var imgChild = document.getElementById("addTreeIcon"); // var currentIndex = 0; if (element.contains(document.activeElement)) { element.childNodes.forEach(function (child) { console.log(child.getElementsByTagName("img")); if (child != document.activeElement) { child.setAttribute("tabindex", "-1"); } else { child.setAttribute("tabindex", "0"); } }); } };

En el parámetro del elemento en función, estoy pasando:

 tabRoving(document.getElementById('treeView'));

Aquí treeView es el nodo principal. Y la imagen con id addTreeIcon está dentro de parentNode treeView .

Cómo puedo hacer esto ? Gracias.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!