このdivの外側にあるpタグを削除するにはどうすればいいですか(ではありません。はテストdivを削除します)。jQuery divの片側を削除します
私が好きな結果は次のようになり<p>
<div class='test'>
content here
<img />
</div>
</p>
...
<div class='test'>
content here
<img />
</div>
私はここに同様の質問があります知っている:jQuery: How do I remove surrounding div tags?が、それは私の状況で
を動作するようになっていない、私は」しようとしました
$('p .test').replaceWith($('.test));
もちろん、p befではなくsalon-slideshow divを選択するだけですそれを鉱石。
[親部門の削除は可能ですが、親の内部は削除できません](http://stackoverflow.com/questions/5201834/remove-the-parent-div-but-not-whats-inside-the - 親) –
Btw。 'p'の中の' div'を持つことは無効です。 –