If you want this to be really flexible, you should put the footnote number inside the footnote tag and the reference tag:
<p>
Blah blah blah blah<a href='#' data-footnote="5" class='footnote'>[5]</a>
</p>
<span class='reference' id='reference-5'>Doe, John. <em>The Book of Blah</em>. 2013.</span>
As for the javascript:
$(document).ready(function() {
$('.reference').hide();
$('.footnote').click(function() {
$('#reference-' + this.getAttribute('data-footnote') ).toggle('slow');
return false;
});
});