Uncle Jim's
Web Site Creations

JavaScript Examples

FOCUS AND SELECT

This example shows you how to set the onSelect and onFocus propertiesfor specific fields.
The first example gives you a click button that will select the contents of the field.


<input type="button" value="Select" onClick="this.form.a.focus();this.form.a.select();">


This script automatically clears the form field when clicked.

<input type="text" onFocus="this.value=''" value="Click inside this box">