Try this (txtID is your control ID):
function selectAll(txtID) {
$(txtID).setSelectionRange(0, $(txtID).val().length)
}
Next time search for the solution before asking for easily found answers.
If this helps please take time to accept the solution. Thank you.