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 178151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:10:52+00:00 2026-05-11T14:10:52+00:00

I am trying to understand why you would use jQuery.get() and jQuery.get(index) . The

  • 0

I am trying to understand why you would use jQuery.get() and jQuery.get(index). The docs say it is to convert the jQuery selection to the raw DOM object instead of working with the selection as a jQuery object and the methods available to it.

So a quick example:

$('div').get(0).innerHTML; 

is the same as:

$('div').html(); 

Obviously this is a bad example but I am struggling to figure when you would use .get(). Can you help me understand when I would use this method in my code?

  • 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. 2026-05-11T14:10:52+00:00Added an answer on May 11, 2026 at 2:10 pm

    Cody Lindley (jQuery Team Member) has a great example of why you would use get()

    If you ever need to cache a set of elements, because you are about to remove them, the jQuery get() method is really handy. For example, in the code below I am saving all my <li> elements on the page in an array, removing them, and then adding them back into the page using this array. Make sense?

    <html>  <head>  <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js'></script>  </head>  <body>  <ul>      <li>test</li>      <li>test</li>      <li>test</li>      <li>test</li>      <li>test</li>      <li>test</li>      <li>test</li>      <li>test</li>   </ul>  <script>  var test = $('ul li').get();  $('ul').empty();  $.each(test, function(){ $('ul').append('<li>'+$(this).html() + ' new</li>'); });  </script>  </body>  </html> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the official jQuery autocomplete plugin with an ASMX web service
Trying to get comfortable with jQuery and I have encountered some sample code that
Trying to understand why you can't use sql_variant for the value type when using
I am trying to understand the core of object oriented programming for php or
Im trying to use this code: <script> jQuery('#MySelectorDiv').fadeTo(500,0.2); </script> To fade out a bunch
Trying to understand an fft (Fast Fourier Transform) routine I'm using (stealing)(recycling) Input is
After trying to understand why client code is not rendered in a page (injected
I've been trying to understand how Ruby blocks work, and to do that I've
I've been trying to understand Process.MainWindowHandle . According to MSDN; The main window is
I'm trying to understand someone else's Perl code without knowing much Perl myself. I

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.