document.queryselector picks first or last
var elFirst = document.querySelector(".myclass"); //first element
var elLast = document.querySelector(".myclass:last-child"); //last element
But be careful!
:last-child and :first-child are relevant to the parent element,
not to the list! It means that there could be several first-childs
and several last-childs
Also in JavaScript:
- hoisting js
- content disposition attachment javascript fetch download "excel"
- random number js
- eslint disable block
- convert string of expression in to expression in javascript
- add variable inside regex in javascript
- extendscript unzip file
- javascript get current month
- send data from form to another page angular
- javascript function in brackets
- string slicing javascript
- angular component lifecycle hooks
- array unique values javascript
- stripe stripe js
- javascript dispatch a custom event
- div click outside to hide javascript
- react native class component template keyboard shortcut
- how to use reduce in javascript
- v-for vuejs
- delete first character javascript
- ejecutar una funcion js con id html usando jquery
- async for loop
- fetch download blob file
- get domain name javascript