Reigel's demo page
HTML
<div class="before">
<h1>before</h1>
<label for='checkbox_elem'>
Links to <a href='somepage.php' target='anotherwindow'>another page.</a>
</label> <br />
<label for='checkbox_elem'>
Links to <a href='somepage.php' target='anotherwindow'>another page.</a>
</label> <br />
<label for='checkbox_elem'>
Links to <a href='somepage.php' target='anotherwindow'>another page.</a>
</label>
</div>
<div class="after">
<h1>after</h1>
<label for='checkbox_elem'>
Links to <a href='somepage.php' target='anotherwindow'>another page.</a>
</label> <br />
<label for='checkbox_elem'>
Links to <a href='somepage.php' target='anotherwindow'>another page.</a>
</label> <br />
<label for='checkbox_elem'>
Links to <a href='somepage.php' target='anotherwindow'>another page.</a>
</label>
</div>
CSS
label {
border: 1px solid blue;
}
a {
text-decoration: none;
}
h1 {
font-weight: bold;
margin-top: 10px;
}
JavaScript
$(document).ready(function(){
$('.after label').find('a').each(function(){
var $anchor = $(this);
$(this).closest('label').after($anchor);
});
});