Home > JavaScript, Tips & Tricks > Set default image or text in html input box

Set default image or text in html input box

Suppose you have a user login panel which shows two input text field, one for username & another for password. Now you don’t wanna use level for this input box. Then What!!!!!!!

Simply show text or image inside input box.

Here is the code…..

<form action="#" method="post">

 <input name="login_username" value="email" type="text"  onfocus="if(this.value=='email') this.value='';" onblur="if(this.value=='') this.value='email';" />

 <input name="login_password" value="" type="password" style="background:url(../images/password.gif);"/>

 <input value="GO" name="login" type="submit" />

 <a href='#'>forgot password?</a>

 </form>

Advertisement
Categories: JavaScript, Tips & Tricks
  1. No comments yet.
  1. No trackbacks yet.

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.