JS - get element by class name with getElementsByClassName

0 votes
87 views
added Dec 17, 2020 in Javascript by lcjr First Warrant Officer (9,190 points)
var pgImg = document.getElementsByClassName('my-box').images[0].src;

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...