Special Work in text field in HTML Form

Hello

We are ready to learn how to write onblue() and onfocus() mouse option. First we write simple HTML form in a HTML page. The code is like that-

<html>
<head>
<title>    </title>
</head>
<body>
<form name=”” id=”” method=”POST” action=””>
Search : <input type=”text” name=”” id=”” value=”Text” />
</form>
</body>

</html>

Then, we add some mouse options in text field. After adding that, It should be-

<input type=”text” name=”” id=”” value=”Text” onfocus=”if(this.value==’Text’)this.value=”” onblur=”if(this.value==”)this.value=’Text'”  />

Ok, then SAVE this file and browse this page. You will get beautiful result Insallah.

Thanks for reading this tutorial.


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s