title: jquery error from variable selector name. Can someone show me the proper way to do this?
body: <p>If it isn't clear what I'm trying to do here, I need to select a dynamically generated class from the document and bind a click function to it. Here is the code. Selecting the variable class, if it exists is posing the problem.</p>
  
  <pre><code>if( item.current == '2' )
                      {
  
                           playBeep = true;
  
                          htmlStr += '&lt;tr class="current-alert curaler' + incrementer.toString() + '"&gt;';
  
                          var selectorString = 'curaler' + incrementer.toString();
  
  
                          $( ('.' + selectorString) ).bind( 'click' , function() 
                              {
  
                              alert('hi');
  
  
  
                              });
  
                      } 
                  else if ( item.current == '1')
                      {
                       htmlStr += '&lt;tr class="current"&gt;';
                      } 
                  else 
                      {
                          htmlStr += '&lt;tr&gt;';
                      }
  
                  htmlStr += '        &lt;td class="first"&gt;' + item.percent + '%&lt;/td&gt;';
                  htmlStr += '        &lt;td class="second ' + ( ( item.current == '2' ) ? 'sym' + incrementer.toString() : '' ) + ' "&gt;' + item.symbol + '&lt;/td&gt;';
  
                  if(item.symbol != 'CASH'){
                      htmlStr += '        &lt;td class="third"&gt;@&lt;/td&gt;';
                  } else {
                      htmlStr += '        &lt;td class="third"&gt; &lt;/td&gt;';
                  }
  
                  htmlStr += '        &lt;td class="fourth"&gt;' + item.purchasedAt + '&lt;/td&gt;';
                  htmlStr += '        &lt;td class="stockName"&gt;' + item.fullName + '&lt;/td&gt;';
                  htmlStr += '    &lt;/tr&gt;';
              });
              htmlStr += '    &lt;/table&gt;';
          } else {
              htmlStr += "&lt;i&gt;100% Cash&lt;/i&gt;";
          }
  </code></pre>