0162Name_Not_Found
2017/12/08(金) 01:53:01.14ID:???画像のパスの一部を書き換えるjsを書いてるんですが
ネットで調べてページすべての画像は↓で変更できるようになったのですが、
特定のclass(<div class="gallery">)の中にある<img>画像だけ書き換える時の書き方がわかりません。
jsマスターの方、ご教授ください。
window.onload = function() {
var images = document.images;
for (var i=0, n=images.length; i<n; i++) {
var img = images[i];
img.src = img.src.replace(/xxx/, 'xxx_s');
}
};