I know that by using jQuery
you can easily use :last
selector to get the last element.
$(".some-element:last")
Although, this does not work with javascript.
document.querySelectorAll(".some-element:last")
What would be the best and shortest way to do the same thing in javascript
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…