Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

101
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda