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

183
Views
How to retrieve a Javascript value that doesn't have a subclass

I'm trying to retrieve a value from a Javascript that does not have a subclass. In this case, I am trying to retreive the "Today" value:

<div class="jobsearch-JobMetadataFooter">
    <div>Today</div>

Can it be done? If so, how?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can use selector: .jobsearch-JobMetadataFooter>div

console.log($(".jobsearch-JobMetadataFooter>div").first().text());

console.log(document.querySelector(".jobsearch-JobMetadataFooter>div").innerText);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="jobsearch-JobMetadataFooter">
  <div>Today</div>
</div>

Updated: use 2 ways by jQuery and javascript.

about 4 years ago · Juan Pablo Isaza Report

0

You can grab the text inside the child div like this.

var parent = Document.getElementsByClassName("jobsearch-JobMetadataFooter")[0];
var child = parent.childNodes;
var text = child[1].innerHTML;

Edit: Juan is absolutely right. I had the child index wrong previously.

about 4 years ago · Juan Pablo Isaza Report
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!