var someElementsItems = document.querySelectorAll(".some-element"); console.log(someElementsItems[someElementsItems.length -1])