headerIMG

B2B Articles - May 18, 2011 - By Ironpaper

Clear form field with mouse click using simple Javascript (focus)

Making a user's experience enjoyable and hassle-free is a vital part of web design and development. In many website projects, you may need to have an HTML form with values pre-filled to describe the type of field the user is accessing.  This is one of the simplest ways to execute this approach. It uses a simple  event called onFocus to remove the text within "value".


<input type="text" name="myField" size=16 value="Click to remove text" onFocus="javascript:this.value=''" />
<input type="submit" />

Tel 212-993-7809  

Ironpaper ®
10 East 33rd Street 
6th Floor
New York, NY 10016
Map

Ironpaper - B2B Agency

B2B Marketing and Growth Agency.

Grow your B2B business boldly. Ironpaper is a B2B marketing agency. We build growth engines for marketing and sales success. We drive demand generation campaigns, ABM programs, B2B content, sales enablement, qualified leads, and B2B marketing efforts. 

Ironpaper Twitter Ironpaper Linkedin