问题描述:

How do I select/highlight the default value inside the input on focus?

thanks

网友答案:

Take a look at this article:

<input type="text" id="txtInput" />

and then:

$('#txtInput').click(function() { 
    var textbox = $(this);
    textbox.focus();
    textbox.select();
});
网友答案:
$('input').focus(function() {
  $(this).select();
});
相关阅读:
Top