in a div, have elements (not necessarily 2nd generation) with attribute move_id.
move_id
First, would like most direct way of fetching first and last elements o
:last is not part of the css spec, this is jQuery specific.
:last
you should be looking for last-child
var first = div.querySelector('[move_id]:first-child'); var last = div.querySelector('[move_id]:last-child');