jQuery: How to make keyboard Event do the same on click event together
<p>I need to make click event and arrow right make the same event</p>

<p>So instead of this repeated code</p>

<pre><code>$('#foo').on('click',function() {
    //do something
});

$(document).keydown(function(e){
   if (e.keyCode == 39) {
    //do the same thing above
   }
});
</code></pre>

<p>How should i do it?</p>

<p>Thank You :)</p>
