<p>I have a bit of html like so:</p>

<pre><code>&lt;a href="#somthing" id="a1"&gt;&lt;img src="something" /&gt;&lt;/a&gt;
&lt;a href="#somthing" id="a2"&gt;&lt;img src="something" /&gt;&lt;/a&gt;
</code></pre>

<p>I need to strip off the links so I'm just left with a couple of image tags. What would be the most efficient way to do this with jQuery?</p>

```
```
$("a > img").parent()   // match all <a><img></a>, select <a> parents
   .each( function()    // for each link
   { 
      $(this).replaceWith(              // replace the <a>
         $(this).children().remove() ); // with its detached children.
   });
```
```