I have the following HTML (that is repeated many times) and want to get the contents of the span immediately before the href that I click.

```
<p class="listitem">
  <img src="./1.jpg" alt="" width="50" height="50"/>
  <span class="votecount">22</span> Votes
  <span class="name">Richard Wilde</span>
  <a href="ViewEntry.aspx?Id=1019">View Entry</a>
  <div id="id-1"><a href="#" rel="vote-1019" >...</a></div>
</p>

```

I also have the following jquery, I am trying to populate count with 22 but can't seem to figure this one out.

```
$("a[rel^='vote']").click(function () {
  var id = ($(this).attr("rel")).replace("vote-", "");
  $(this).unbind("click");
  var count= $(this).parent("div").parent(".listitem").children(".votecount");
  return false;
}); 

```

*edit* sorry, even I add .text() on end I get NULL, I think the traversing is not quite right.