.focus() | jQuery API Documentation
You've seen those cool search boxes or login fields on websites which have some default value like e. This post shows how to change the default value of an HTML text field on focus and blur with jQuery.Get The Value Of An Input Text Box Using Jquery
The best way to illustrate what I'm talking about is with an example. If you're viewing this in a RSS feed reader then you'll need to click through to this post in a web browser to be able to use the example below.
Play around with the example above by clicking one of the fields and then clicking out of it. You'll see the text go away and jquery input default value focus come back again.
If you click into the field, change the text and then click out again the new text online typing work at home in pakistan changed it to will stay there.
Here's the jQuery code which implements the above. They don't even need to have an id attribute. And finally, you could also change the styles of the text box on focus and blur, as shown in the following code example which is a modification of the above.
Changing the default text value on focus with jQuery - Electric Toolbox
I've highlighted the modifications in red in the example below which makes the text a lighter color when it's showing the default text and a darker color when focussed. The next jQuery post will look at something similar, showing "Password" in plain text for a password field but changing to a proper password field with the password obscured on focus. I've followed these two posts up with a full working example which combines the two together, and has all the necessary source code all together.