Is there a way to use Jquery's .unwrap() multiple times without copying and pasting? It'd be nice if it could accept an argument or something like: .unwrap(4) but it doesn't. Is there a more clever solution to achieving the following:?
$(".foo a").unwrap().unwrap().unwrap().unwrap();
<li class="foo">
<div>
<ul>
<li>
<div>
<a href="#">Link</a>
</div>
</li>
</ul>
</div>
</li>
Aucun commentaire:
Enregistrer un commentaire