CherylAN
CherylAN

Reputation: 11

Change HTML with iMacros

I am trying to change this with iMacros:

<div id="outerd3">    
  <img src="bnner0.jgp" alt="">    
  <img src="flamingo.jpg" alt="">    
  <img src="avatar.jpg" alt="">   
</div>

into this

<div id="outerd3">    
  <img src="avatar.jpg" alt="">    
  <img src="avatar.jpg" alt="">    
  <img src="avatar.jpg" alt="">    
</div>

If possible, please help me to achieve this.

Upvotes: 1

Views: 337

Answers (2)

Shugar
Shugar

Reputation: 5299

And here is a solution for 'iMacros':

URL GOTO=javascript:(function(){var<SP>img=document.querySelector("#outerd3").querySelectorAll("img");for(i=0;i<img.length;i++)img[i].src="avatar.jpg";})();

Upvotes: 1

Mohammad Ali Rony
Mohammad Ali Rony

Reputation: 4905

You can use this code for change img src.

$('img').each(function () {
    $(this).attr("src","avatar.jpg");
});

Upvotes: 1

Related Questions