Tuesday, September 16, 2008

Auto delete text on textbox on focus and restore text on unfocus

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title> new document </title>
<meta name="generator" content="" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>

<body>
<input type="text" id="email" value="Your e-mail here" onfocus="if(this.value=='Your e-mail here')this.value=''"
onblur="if(this.value=='')this.value='Your e-mail here'" />
</body>

</html>

Result:

No comments:

Post a Comment