When the Enter key is pressed, the bound button click event code is as follows. By detecting the pressed key value, the Enter key keycode is 13, determine whether it is the Enter key, and then complete the corresponding method. Copy code The code is as follows: <br>$(function() { <br>$(document).keydown(function(event){ <br>if(event.keyCode==13){ <br>$("#mouse").click(); <br>} <br>}); <br><br>$("#mouse").click(function(){ <br>alert("nihao"); <br>}); <br>}) <br>< /script> <br> </div>