How to write the keypress event in Jquery/ Javascript?
<p>I am new to Jquery and Javascript. Need a help regarding this problem: </p>

<p>There is a div named <code>Profile</code> , If I click that then a new popup window will open. Now this is only possible by a mouse click. I need it to be done by key press (enter) also.</p>

<p><strong>JSP CODE FOR THE DIV</strong></p>

<pre><code>&lt;div tabindex="0" style="text-decoration:underline" onmouseover="this.style.cursor='pointer';" id="&lt;%=namespace%&gt;_pmProfileName_&lt;%=i%&gt;_" onclick="perfChartConfig_&lt;%=namespace%&gt;.doShowProfilesForElement(this);"&gt;Profile&lt;/div&gt;
</code></pre>

<p><strong>JQUERY/JAVASCRIPT CODE</strong></p>

<pre><code>    doShowProfilesForElement : function(source){

    var callback = {       
     success : function(r) { 
        MO.globals.popups.hideWorkingMsg();  
        this.argument[0].pe = eval("("+r.responseText+")");  
        var pe = this.argument[0].pe; 

        var pStr = '';
        if(this.argument[1].indexOf("pmProfileName") &gt; 0){
            if(pe == null || pe._mosol_AllPerfProfileNames.length==0){
                pStr = pStr + "&lt;li&gt;There are no profiles available for the element you selected.&lt;/li&gt;";
            } else {
                for(var i=0; i&lt;pe._mosol_AllPerfProfileNames.length;i++){
                    var profile = pe._mosol_AllPerfProfileNames[i];
                    var onClick = "onClick=\"perfChartConfig_&lt;%=namespace%&gt;.doProfileSelection(this,'"+this.argument[1]+"');\"";
                    pStr = pStr + "&lt;div style=\"text-decoration:underline\" onmouseover=\"this.style.cursor='pointer';\" "+onClick+" &gt;"+profile+"&lt;/div&gt;";
                    //alert('For profile ['+profile+'] there are '+pe[profile].length+' expressions.');         
                }
            }
        }
        if(this.argument[1].indexOf("slaProfileName") &gt; 0){
            if(pe == null || pe.offers.length==0){
                pStr = pStr + "&lt;li&gt;There are no SLAs available for the element you selected.&lt;/li&gt;";
            } else {
                for(var i=0; i&lt;pe.offers.length;i++){
                    var profile = pe.offers[i];
                    var onClick = "onClick=\"perfChartConfig_&lt;%=namespace%&gt;.doProfileSelection(this,'"+this.argument[1]+"');\"";
                    pStr = pStr + "&lt;div style=\"text-decoration:underline\" onmouseover=\"this.style.cursor='pointer';\" "+onClick+" &gt;"+profile+"&lt;/div&gt;";
                }
            }
        }


        var rp = perfChartConfig_&lt;%=namespace%&gt;.rp;
        rp.setHeader("Select a Profile you want to chart:"); 
        rp.setBody(pStr); 
        rp.render();     
        rp.show();  
     },         
     failure : function(r) { 
        MO.globals.popups.hideWorkingMsg();
        MO.globals.popups.showMsg("Error", "&lt;h2&gt;&lt;span class=\"portlet-msg-error\"&gt;Your submission failed&lt;/span&gt;"+"&lt;br /&gt;Status: " + r.status + "&lt;/h2&gt;");
     },    
     argument: [this, source.id]    
   };
</code></pre>

<p>Would you tell me how to write the function for keypress(enter) ? </p>
