Okay, for some reason, I can't quite seem to get what I need. I'm close, but for some reason can't quite put the last piece of the puzzle together. 

HTML:

```
<table>
  <tr>
    <td>
      <a href="/path/to/larger/image.jpg"><img src="/path/to/image.jpg"/></a>
      <br/>Some caption <a href="http://somesite.com">text</a>.
    </td>
   </tr>
</table>

```

JavaScript: 

```
$(function(){
  $('.fancy-gallery td > a').each(function(){
    var title = $(this).parent().html();
    $(this).attr('data-fancybox-title', title);
    $(this).attr('data-fancybox-group', 'group-' + $(this).closest('.textarea').attr('id'));
  });
});

```

So this gives me everything in the TD including the first anchor and image. I've tried using the .remove() and that didn't work, I've also tried using .not, and that also didn't work.

Basically what I need to do is remove the first `<a/>` tag and any line breaks (like `<br/>`). Then assign that to the data-fancybox-title attribute.

Any help is appreciated.