OK, first of all: You can’t have multiple IDs of the same kind in a document, an ID must be unique and may only occur once per document. If you want to have multiple elements with the same designator you need to use classes.
Then to search something from the last child you can use the
function (in combination with jQuery’s
selector) to manipulate nodes from the end until a certain one.