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

102
Vistas
Am I on the right track?

I am doing a javascript coding challenge where I must get references from the nav buttons from the HTML file. its for a registration form

HTML

<!-- Conditional Nav buttons -->
        <nav>
            <button class="users" id="users-tab-button">Register User</button>
            <button class="register" id="register-tab-button">View User List</button>
        </nav>
    <!-- /Conditional Nav buttons/ -->

JS

/* ----------------------------------------------------
    Setup
---------------------------------------------------- */

/* --- Tab References --- */

    // Get reference to all elements in register tab
    const registerTab = document.getElementsByClassName("register");
    console.log(registerTab);

    // Get reference to all elements in userList tab
    const userTabs = document.getElementsByClassName("users");
    console.log(userTabs);


/* --- Nav references --- */
//get refernce to Register User button
const regUser = document.querySelector('#users-tab-button');
console.log(regUser);

//get reference to viewUserList button
const viewUserList = document.querySelector("#register-tab-button")
console.log(viewUserList);

What I am doing here is getting the IDs of the nav buttons, but now, do I need to link them to the registerTab and the userTabs? as well, as it stands the regUser and the viewUserList are showing null

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