how do i enable automatic select a text field with javascript?

i mean if i have a form and i want the user to just click the field and be able to copy