right click jquery
<p>I am trying to create a context menu,when i right click on text box.I did it when i click,i am able to select using mouse but i need it using key up and key down too.</p>

<pre><code> $(window).load(function(){
$(document).bind("contextmenu", function(event) { 
    event.preventDefault();
    $("&lt;div class='custom-menu'&gt;Custom menu&lt;/div&gt;")
        .appendTo("body")
        .css({top: event.pageY + "px", left: event.pageX + "px"});
}).bind("click", function(event) {
    $("div.custom-menu").hide();
});
}).bind("keyup",function(event) {
   $("div.custom-menu").hide();
});
 }).bind("keydown",function(event) {
   $("div.custom-menu").hide();
});
  });
</code></pre>

<p>html</p>

<pre><code> input type="text" name="firstbox" id="firstbox" onclick="append()"
</code></pre>

<p>here that right click works on whole page bcoz i have given body ,how to make that work on text box.</p>
