I’m using Chrome and the build in developer tools. What I do the following in the console
$('.votes > a > img')[0]
I get this
<img src="/myimage_png">
But if I do
$('.votes > a > img')[0].get(0).tagName
I get
TypeError: Object #<HTMLImageElement> has no method 'get'
I don’t understand why sometimes I’m able to do .get(0).tagName and sometimes I’m not (depending on what my selector is of course)
.get()retrieves a specified DOM element from a list of elements. the$('.votes ...')stuff call returns such an element list. You dereference this list with[0], fetching the first of the found nodes. That means you’re no longer working with a DOMNode list, you’re working with a DOMElement, and a DOMElement has no.get()method.