remove element but leave inner content?

remove element but leave inner content?

Assume I have a html structure like


  1. <div class="aaa">
  2. ....
  3. <a href="http://.......>linktext</a>
  4. ...
  5. <a href="http://.......>other linktext</a>
  6. ...
  7. </div>


Now I want ot remove (only inside the div[aaa] element) all wrapping <a> elements which contain a href= attribute but leave the inner content of the <a> elements´. When I code something like

$("div.aaa).$("a[href]").unwrap();

then the wrapping div.aaa is removed and not the <a> s


How can I achieve this (otherwise)?


Peter