Javascript 原型:更改属性
如何更改Javascript 原型:更改属性,javascript,prototypejs,Javascript,Prototypejs,如何更改 $('item1').getElementsBySelector('img') 也可以使用setAttribute函数 var imgs = $('item1').getElementsBySelector('img'); imgs.each(function(img) { img.setAttribute('src','newSrc'); img.setAttribute('width','100px'); }); var imgs = $('item1').ge
$('item1').getElementsBySelector('img')
也可以使用setAttribute函数
var imgs = $('item1').getElementsBySelector('img');
imgs.each(function(img) {
img.setAttribute('src','newSrc');
img.setAttribute('width','100px');
});
var imgs = $('item1').getElementsBySelector('img');
imgs.each(function(img) {
img.setAttribute('src','newSrc');
img.setAttribute('width','100px');
});