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

94
Views
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
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!