title: Javascript/Jquery code skips whole function in debugger
body: <pre><code>function bet() {
      $('table img').css('cursor', 'pointer');
      $('table img').click(function () {
          yourBetNumber = $(this).slice(0, -1);       
          $('#item' + yourBetNumber).clone().appendTo('#yourbet');
          $('table').hide();
          $('table img').css('cursor', 'pointer');
      });
  }
  </code></pre>
  
  <p>I have a table of items displayed, each item is a different image and has a unique ID in the html. What I'm trying to do is enable the user to click on the item they want to bet on and that should be registered as their bet number. I'm not sure the slice part is correct yet, but that's not the point - the function isn't executed at all even though I call it in the code. The debugger also just skips over it entirely when I try to step into the next line (tried with breakpoints etc). </p>
  
  <p>Any idea why this happens and how it could be fixed please?</p>