title: Can I change img src in html?
body: <p>It's like</p>
  
  <pre><code>&lt;img src="somesrc" file="filepath" /&gt;
  </code></pre>
  
  <p>The src is not the correct url, how can I load the img using the url in file attribute for all images?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery
  /jquery-1.4.min.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;img src="wrongsrc" file="http://www.hi-pda.com/forum/uc_server/data/avatar/000/52/56/39_avatar_middle.jpg"&gt;&lt;/img&gt;
  
      &lt;script &gt;   
  $("img").each(function(){
  var filepath = $(this).prop("file");
  if (filepath) this.src=filepath; 
  }); 
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I change my code to this, but it does not work.</p>