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

119
Views
jQuery how to replace :last selector if I need its children?

I am upgrading my code for the latest jQuery, but I stumbled into a problem with deprecated :last selector. In most cases, all I needed to do was to delete it and slap .last() after, but I have a problem with this:

$('#someId tr:last textarea').each(function(){
    //some code
});

where :last is not the ultimate thing I want to select. I don't even know how to form the google question for this. How can I approach this?

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

0

You can still continue selecting after .last() (that's basic functionality of jquery, I advice to read up on it if you want to continue to use it) or simply use css selector :last-child

$('#someId tr:last-child textarea').each(function(){
    //some code
});

or

$('#someId tr').last().find('textarea').each(function(){
    //some code
});
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!