What is a JavaScript or jQuery solution that will select all of the contents of a textbox when the textbox receives focus?
views:
1773answers:
3
+6
A:
$(document).ready(function() {
$("input[type=text]").focus(function() { $(this).select(); } );
});
John Sheehan
2009-01-26 18:06:06
Also just for extra info:"input[type=text]" now can be "input:text"regards
Ricardo Vega
2009-01-26 22:29:00
+3
A:
$(document).ready(function() {
$("input[type=text]").focus().select();
});
Tomas Kirda
2009-04-08 15:37:50
+1 because this was what I needed, but it's not the answer to THIS question.
Cros
2009-12-09 12:05:43