我如何用jQuery做到这一点?
$("#myInputField").focus(function(){ // Select input field contents this.select(); }); // Add this behavior to all text fields $("input[type=text]").focus(function(){ // Select field contents this.select(); });