Q:

Highlight TextBox on page load

I have a TextBox "userName" with some text inside on page load.
I can highlight TextBox on the click event like this with jQuery:
        $(document).ready(function() {

        $('#userName').click(function() { selectAllText($(this)) });

        function selectAllText(textbox) {
            textbox.focus();
            textbox.select();
        }

}):
How can I highlight TextBox "userName" on page load? Much Thanks.

A:

Here's the script. It's so simple.
 $(document).ready(function() {

    $('#userName').select();

});

