title: jQuery: click event called $('textarea').val().trim().length times
body: <p>Well, that's pretty much what happens.</p>
  
  <p>We've all seen this before: button becomes active <strong>and clickable</strong> only after we've put something in an input filed. I'm trying to implement that. I guess either I've gone the wrong way and I should've placed my jQuery selectors differently, or it's just something wrong with the code.</p>
  
  <pre><code>$('textarea').bind({'keyup' : function(){
      if ($(this).val().trim().length){
          $('.send-feedback').removeClass('inactive').click(function(){
              console.log('clicked');
          });
      } else {
          $('.send-feedback').addClass('inactive').off('click');
      }
  }})
  </code></pre>
  
  <p>Basically, I see 'clicked' in the console multiple times, but if I add <code>console.log('key pressed')</code> before the <code>if</code> check, it's being shown once per keydown, as expected. </p>
  
  <p>Any advice?</p>