Asked • 05/10/19

Selecting all text in HTML text input when clicked?

I have the following code to display a textbox in a HTML webpage. <input type="text" id="userid" name="userid" value="Please enter the user ID" />When the page displays, the text contains the *Please enter the user ID* message. However, I found that the user needs to click 3 times in order to select all the text (in this case it is *Please enter the user ID*). Is it possible to select the entire text with only one click?**Edit:**Sorry, I forgot to say: I must use the input `type="text"`

1 Expert Answer

By:

Joshua A. answered • 05/10/19

Tutor
5 (1)

Affordable GIS Trainer

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.