Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8514695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:56:25+00:00 2026-06-11T04:56:25+00:00

Please see this image: Can someone explain the difference? Edit Let me indicate what

  • 0

Please see this image:

enter image description here

Can someone explain the difference?

Edit

Let me indicate what puzzles me. Notice that:

  1. $row.is('tr.items:last') === false
  2. $row[0].id === $('tr.items:last')[0].id

The two statements seem to contradict each other. The first tells us that $row is not the last of tr.items. But the second one tells that $row is exactly $('tr.items:last'), i.e. the last of tr.items.

No such thing occurs with the :last-of-type selector.

What is going on here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:56:29+00:00Added an answer on June 11, 2026 at 4:56 am

    jQuery does a different filter mechanism for .is when it comes to set filters like :last. The point is that it normally uses .filter on the current set and checks whether there are any elements left after filtering.

    This works for cases such as:

    $("<a></a><b></b>").is("b");  // true, there is a <b> after filtering
    

    But for :last this fails, because such a filter is relative to the set. Consider a document with two elements:

    $("a:first").is("a:last");  // would be true if the same method was used,
                                // because in the set with the first <a> element,
                                // the last <a> element is that element. So filtering
                                // with `a:last` yields something, and `.is` gets you
                                // true.
    

    This is in contrast with what you may expect. So, jQuery instead searches for a:last in the current context and checks whether a:first is apparent in that set.

    The problem in your case is that $(ev.target) (in handleKeyDown) makes the context to be that input element and not the document (which is the usual case). No tr.items can be found in that context and you get false. This is arguably a bug in jQuery.

    Anyway, what you can do is checking against a set instead. It is faster to use the corresponding functions, anyway:

    $row.is( $("tr.items").last() );  // true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please see this jsFiddle: https://jsfiddle.net/Wmq6f/ I have a textarea that has a background image,
It seems that i cannot access $(this) inside jquery ajax success function. please see
First of, please check this picture: As you can see, left from Today and
Please see this This Image for a picture of the problem. I have a
Please see this: My code looks like this now: http://jsfiddle.net/Bd9Ut/ As you can see
Can someone please help me understand why this code is not working? $('#quick-search-header.widget-title').css('background-image', 'url(dd_includes/images/icons/sliding-menu-arrow-right.gif)');
Please could someone help diagnose this tiny problem that shouldn't be one - trying
I've been stuck for 2 days on this. Can someone please provide an example
Can please someone put me out of my misery and tell me why this
Please see this example: if (strlen($_SESSION['userDetails']['THISNAME']) == 0) { $_SESSION['userDetails'][''.$THISNAME.'Error'] = autofocus; include $docRoot/html/forms/reg/user_info.html.php;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.