Shoud these two JQuery functions produce the same behavior?
<p>Assuming I have the following two JQuery functions -</p>

<p>The first, which works:</p>

<pre><code>$("#myLink_931").click(function ()
{
  $(".931").toggle();
});
</code></pre>

<p>and the second, which doesn't work:</p>

<pre><code>$("#myLink_931").click(function ()
{
  var class_name = $(this).attr("id").split('_')[1];
  $("."+class_name).toggle();
});
</code></pre>

<p>I want to replace the first with the second, which is more generalizable, but can't find any obvious syntactical problem with the second which might be preventing it from working.</p>

<p>My guess is there's a problem with the syntax:</p>

<pre><code> "."+class_name
</code></pre>

<p>Is this bad syntax?</p>
