title: Add an event listener inside for in loop
body: <pre><code>function listeners(){
      validation = new Validator();
      for(input in inputs){
          el = $("#"+input+"");
          addEvent(el, "input", function(){
              inputs[input].value = el.value;
              if(validation.fails(inputs[input])){
                  //Do something
              }
  
          })
      }
  }
  </code></pre>
  
  <p>Hi guys, i have three inputs <code>{name, email, comment}</code>, and i want to attach an event listener and make some validation to every input. The above code works but it returns always the last input(comment). Please, is there any solution  to solve this problem? I thought about callback, but i didn't know how to implement it in this context.</p>