views:

175

answers:

1

How can I change a <img> with the JS-Library Prototype? I managed it to get the element but I couldn't change the "src":

$('item1').getElementsBySelector('img')
A: 
var imgs = $('item1').getElementsBySelector('img');
imgs.each(function(img) {
    img.src = 'newSrc';
});
David Hedlund