Published
- 1 min read
get last element of getelementsbyclassname in js
The solution for this is noted below
get last element of getelementsbyclassname in js
Solution
var final = document.getElementsByClassName('test')
final[final.length - 1]
Try other methods by searching on the site. That is if this doesn’t work