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

172
Views
getElementById doesn't work only one element but works for others

One getElementById does not work although the others do, everything is spelled correctly and the syntax is correct. testTitle does not return anything in the console although the others do, I have tried rearranging the lines however it results in the same thing.

      <!--test name-->
      <div class="row">
        <div class="col s6 offset-s3">
          <div class="input-field">
            <input type="text" id="testTitle" required />
            <label for="testTitle">test name</label>
          </div>
        </div>
      </div>
      <!--subject-->
      <div class="row">
        <div class="col s6 offset-s3">
          <div class="input-field">
            <input type="text" id="testSubject" required />
            <label for="testSubject">subject</label>
          </div>
        </div>
      </div>
      <!--test date-->
      <div class="row">
        <div class="col s6 offset-s3">
          <div class="input-field">
            <input type="text" class = "datepicker" id="testDate" required />
            <label for="testDate">test date</label>
          </div>
        </div>
      </div>
    add.addEventListener('click', async (e) => {
      
      const testSubject = document.getElementById("testSubject").value;
      const testDate = document.getElementById("testDate").value;
      const testTitle = document.getElementById("testTitle").value;
      console.log(testTitle);
      console.log(testSubject);
      console.log(testDate);
    });
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!