1var elFirst = document.querySelector(".myclass"); //first element
2var elLast = document.querySelector(".myclass:last-child"); //last element
3
4But be careful!
5:last-child and :first-child are relevant to the parent element,
6not to the list! It means that there could be several first-childs
7and several last-childs