To just select the text, you'd do something like:
$(".inputs-to-which-you-want-to-apply-this-behavior").focus(function() {
this.select();
});
Another approach, which does not select the text, but rather removes it (only to replace it if you leave the box empty, would look something like this:
$(document).ready(function() {
$(".inputs-that-currently-have-a-default-value-in-them").each(function() {
var original = $(this).val();
$(this).focus(function() {
if ($(this).val() == original)
$(this).val('');
});
$(this).blur(function() {
if ($(this).val() == '')
$(this).val(original);
});
});
});
(I prefer this latter approach if the text that's in the box to begin with is placeholder text like 'Enter Your Name' but if what's in the box is, for example, the name I entered last time your original idea of just selecting the text would certainly be better.)