loading...

Html Input onclick select text

jwp profile image John Peters Updated on ・1 min read

When users click on an input with text already there, this is the easiest way to pre-select the text for them.

 <input  
  type="text"
  onclick="this.select()" 
 />

Not too difficult except when trying to remember Angular conventions like (click), [(click)],(onClick) etc. No Angular needed...

Discussion

pic
Editor guide