I am calling a function in jQuery, using 'enter' event as well 'blur' event is it possible to shorten it?
<p>I would like to trigger a function when my user blurs or enters a text box. I wrote this code to implement that:</p>

<pre><code>text:function(input,el){
    var textCheck = function(){
        var value = $.trim(el.val());
        if(!value){
             el.addClass('error');
        }else{
             el.removeClass('error');
        }
    }

    $(el).on('blur click keyup', textCheck); //calling the function
    $(el).on('keyup', function(e){ ////calling the function again 
        if(e.keyCode == 13){
             textCheck();
        }
   });
   //instead of calling 2 times, how can i put together as single call?
}
</code></pre>

<p>Can I shorten the code that binds the events?</p>
