title: Similar Jquery functions not firing keyup() more than once
body: <p>I have a few Javascript functions that all look similar to me. but behave differently to how I want them to.</p>
  
  <p>I would like another element to be updated with some text when the value of the input has been evaluated. However for code reuseability I would like to pass the element to be updated to the function, but when I do this the <code>keyup()</code> event will not fire when text is typed into the input box.</p>
  
  <p><strong>Why is this?</strong></p>
  
  <p>Here is the one that works, but I have so specify the element to be updated explicitly.</p>
  
  <p><strong><em>Keyup Working</em></strong></p>
  
  <pre><code>$(function(){ 
       $("#form1").keyup(function(){
           var val = $(this).val();
           if(val.length &lt; 5){
               $("#inputFeedback").html("Less then 5 chars");
           }else{
               $("#inputFeedback").html("More then 5 Chars!");
       }
  });
  </code></pre>
  
  <p>Here is what I would like to do but the <code>keyup()</code> event  will not work on.</p>
  
  <p><strong><em>Keyup Not working</em></strong></p>
  
  <pre><code>var validate = function(feedback){
     var val = $(this).val();
     if(val.length &lt; 5){
         $(feedback).html("Less then 5 chars");
     }else{
         $(feedback).html("More then 5 Chars!");
     }
  }
  
  
  $(function(){
      $("#form1").keyup(validate($("#inputFeedback")));
  });
  </code></pre>
  
  <p><em><strong>Note:</strong> I have also tried as arguments <code>$(this)</code> and <code>"#inputfeedback"</code> to no avail!</em></p>
  
  <p>I have also tried to use classical Javascript <code>function foo(bar){ ... }</code> type functions but this has the same effect as the last example above.</p>
  
  <p>I am sure it is something I am not doing right or understanding here but after a good few hours of searching and reading I can't find anything to help me with this one!</p>
  
  <p>Thanks</p>