I’m working on an application, and I want a text field to be selected when the page is loading so that when a user uses Ctrl + v it paste the content inside the textbox. Any one knows how to do that?
the text field is
<div>
<input wicket:id="email-address" type="text" id="textbox-email" />
</div>
Thanks!
you should set focus to your input:
For your example above:
After it gained focus, you should select it:
either add this
onfocusattribute to your inputs (better)Or use this jQuery snippet (best):
Pure Javascript:
Add the whole thing to
window.onloadoronloadattribute ofbodytag.