JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container">
<div class="article">
<h3>The Moon Causes Cancer</h3>
<p>The moon is made out of cheese<sup>1</sup>. Cheese causes cancer.<sup>2</sup> Therefore the moonburns cause cancer.</p>
</div>
<div class="refs">
<h3>References</h3>
<ol>
<li>Moon is 1% Inspiration, 93% Cheese. <a href="http://www.fox.com" class="source">Fox News</a></li>
<li>Mice Eat Cheese, Get Cancer 100% Correlation. <a href="http://www.fox.com" class="source">Fox News</a></li>
</ol>
</div>
</div>
CSS
body {
font-family:sans-serif;
}
sup {
line-height:0px;
}
#container {
background:#eee;
border-radius:5px;
box-shadow:2px 2px 0px 3px #444;
width:400px;
padding:3px;
}
h3 {
font-weight:bold;
text-transform:uppercase;
}
div.article {
margin:0px 0px 20px 0px;
}
div.refs ol li {
font-size:12px;
}
div.refs ol li a.source {
text-decoration:none;
font-style:italic;
color:#88e;
}
JavaScript
$("div.refs").each(function(i) {
$(this).attr("id", "ref_" + (i + 1));
var temp = $(this).prev(".article").find("sup").text();
$(this).prev(".article").find("sup").prepend("<a href=\"#references" + (i + 1) + "\" class=\"references\">");
$(this).prev(".article").find("sup").append("</a>");
});