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

139
Views
Get span value inside nested div and other HTML element using jQuery

I want to get span value which is inside h1> a> span tag so those span value I want to get but when my jQuery code is getting empty values, unable to figure out what I have missed.

$(".main_content .wpb_wrapper").each((i, elem) => {

  console.log('test::' + $(elem).find(".wpb_content_element >a >span").text());
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>


<div class="main_content">
  1)

  <div class="wpb_text_column wpb_content_element ">
    <div class="wpb_wrapper">
      <h3 style="text-align: center;"><a href="https://abc/"><span style="color: #405789;">abc Estates</span></a></h3>
    </div>
  </div>

</div>

2)

<div class="wpb_wrapper">
  <div class="wpb_text_column wpb_content_element ">
    <div class="wpb_wrapper">
      <h3 style="text-align: center;"><a href="https://xyz/"><span style="color: #405789;">xyz Estates</span></a></h3>
    </div>
  </div>
</div>

3)

<div class="wpb_wrapper">
  <div class="wpb_text_column wpb_content_element ">
    <div class="wpb_wrapper">
      <h3 style="text-align: center;"><a href="https://mm/"><span style="color: #405789;">mm Estates</span></a></h3>
    </div>
  </div>
</div>
</div>

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!