Categories:

Home / Free JavaScripts / Forms / Here

Cut & Paste Auto clear form element

Credit: JavaScript Kit

Description: If you have forms on your page that contain default text in them, this is a great time-saving script that makes life easier for your visitors that have to fill them out. The script automatically clears the default text inside the containing form element when the user sets focus on it, so the user can just aim, focus, and starting typing. Cool!

Example:

Directions: Simply cut and paste the below code into the form element(s) you wish to automatically clear when the user sets focus on it:

Here's an example:

<form>
<input type="text" onFocus="this.value=''" value="Email address here">
</form>


JavaScript Tools:
Site Info


CopyRight (c) 2018 JavaScript Kit. NO PART may be reproduced without author's permission. Contact Info