with the dom,
document.getElementsByClassName("myClass")[2]
selects the 3rd element of class myClass
in jQuery,
$('.myClass')
gets class myClass but how can I get the 3rd element?!
Instead of $('.myClass:eq(2)') you can also use $('.myClass').eq(2) or, if you want a DOM element instead of a jQuery element, $('.myClass').get(2)
obj.attr('id') or obj[0].id (the [] subscript operator returns the contained dom objects); using the DOM object you use obj.id.