JS - get element by class name with getElementsByClassName

0 votes
163 views
added Dec 17, 2020 in Javascript by lcjr First Warrant Officer (11,110 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.
...