var imgScrs="";var imgs = document.getElementsByTagName("img");for(var i=0;i imgScrs+=imgs [i].src; if(i+1}
Jquery写法: var text=""; $('img').each(function(){ text=text+'|'+$(this).attr('src'); }); alert(text.substr(1)); }