[jQuery] Remove links but not images

[jQuery] Remove links but not images


Hi folks
This has me stumped. I have a list of images and I want to remove the
links but retain the images.
So this
<ul>
<li><a href="foo"><img src="path/to/image1" /></a></li>
<li><a href="foo"><img src="path/to/image2" /></a></li>
etc etc
</ul>
Becomes this
<ul>
<li><img src="path/to/image1" /></li>
<li><img src="path/to/image2" /></li>
</ul>
Using this
$('ul a').remove();
does not work as it also removes the images as well.
Any help would be much appreciated. Thanks in advance.
Alex