-2

This table is in a template, I cannot directly edit the HTML and need the links to be in a different order, I need to move the "about" link below the "donate" link.

<table class="leftnav">

<tbody>

<tr>
<td class="headergraphica">
<img src=".../images/ta.gif">
</td>
</tr>

<tr>
<td class="leftlinkheading">Information</td>
</tr>

<tr>
<td class="leftlink"><a href="#">event information</a></td>
</tr>

<tr>
<td class="leftlink"><a href="#">about</a></td>
</tr>

<tr>
<td class="leftlink"><a href="#">participate</a></td>
</tr>

<tr>
<td class="leftlink"><a href="#">donate</a></td>
</tr>

</tbody>
</table>
Jenny
  • 781
  • 1
  • 9
  • 24

2 Answers2

1

You can do it like this -

$('.leftlink a:contains("donate")').closest('tr')
           .after($('.leftlink a:contains("about")').closest('tr'));

Demo -----> http://jsfiddle.net/zCZfT/

Adil Shaikh
  • 44,509
  • 17
  • 89
  • 111
0

See some examples here

Could probably do

$(".leftnav tr:eq(3)").appendTo(".leftnav tbody");
Community
  • 1
  • 1
Matthew
  • 155
  • 4