Pass variables with append jquery
<p>Just getting back into jQuery and JS and I am forgetting the basics..</p>

<pre><code>J(".thSort").click(function() {
    var num = J(this).parent().index() + 1;
    var thName = J(this).parent().children().html();
    J("table td:nth-child("+ num +"),th:nth-child("+ num +")").hide('slow');
    J('.filterToggle').append(' &lt;a href="#" onClick="J("table td:nth-child("+ num +"),th:nth-child("+ num +")").show();"&gt; Show "thName" &lt;/a&gt;');
});
</code></pre>

<p>Essentially this is hiding columns when I click an X with the class thSort. When it hides a column I want it to write to a div I have elsewhere what items have been hidden so people can "show" them again.</p>
