I have this HTML
<div class="box">
<a href="#goals"> | <a href="#rules"> | <a href="#controls">
<p><a name="goals"></a></p>
<h2>Goals</h2>
... yada yada
and want it like this.
<div id="nav">
<a href="#goals"> | <a href="#rules"> | <a href="#controls">
</div>
JQuery have wrapAll(), but I can only select the links so the "|" gets left outside the div.
before('div') and after('div') creates a closed element, like <div></div>
so what to do?
I'm using
$('.box a[href^="#"]')
to select the links. They are part of a text resource file, so I cant edit anything.