title: On site load, how do you wrap all images in a link dynamically using Javascript?
body: <p>I have barely any experience working with DOM and using Javascript, and I have a very specific task that I'm trying to accomplish. </p>
  
  <p>Let's say I have an image in my HTML:</p>
  
  <pre><code>&lt;img src="foo.jpg" /&gt;
  </code></pre>
  
  <p>When the site loads, I want to take that image (all images in the document, actually), and wrap them in a link:</p>
  
  <pre><code>&lt;a href="http://www.foobar.com"&gt;&lt;img src="foo.jpg" /&gt;&lt;/a&gt;
  </code></pre>
  
  <p>What could I use to accomplish this? Google hasn't turned up much for me with regards to this specific task. On load, I can access and iterate all the images in the document... but I'm not sure where to go from there in order to wrap the image in a link. </p>