Can't quite get this code to enact on all elements within my html - I know [0] means just one - but the code doesn't work without it as its raw js
window.onload = function yourFunction(){
var str = document.getElementsByClassName('icon')[0].innerHTML;
var res = str.replace(/_s\.png/g, ".png")
document.getElementsByClassName('icon')[0].innerHTML = res;
setTimeout(yourFunction, 5000);
}
yourFunction();
See the JSFiddle
I want to it work for all _s instances within the 'icon' classes