jQuery.get() - Practical uses?

Posted by RedWolves on Stack Overflow See other posts from Stack Overflow or by RedWolves
Published on 2009-04-19T16:49:39Z Indexed on 2010/05/26 12:01 UTC
Read the original article Hit count: 147

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery