What is a Vanilla JS or jQuery solution that will select all of the contents of a textbox when the textbox receives focus?
Advertisement
Answer
$(document).ready(function() { $("input:text").focus(function() { $(this).select(); } ); });
What is a Vanilla JS or jQuery solution that will select all of the contents of a textbox when the textbox receives focus?
$(document).ready(function() { $("input:text").focus(function() { $(this).select(); } ); });