Written by Saran on April 28, 2012, Updated December 21, 2013
No wonder you must have tried many Javascript codes before to achieve placeholder or in lame man's term watermark like text in your form input fields. Javascript codes can be bit messy but of-course you can achieve whatever you want with your input boxes. But there another neat HTML5 way to place watermark text in your input boxes. HTML5 recently added some new features for user input fields, such as input attribute called placeholder. This attribute simply adds an default text if input field is empty, so there's no need to write Javascript codes to achieve just that.To create a placeholder in an input box, just add placeholder attribute like this : [cc lang="html"] [/cc] and you should get something similar:
Arjun
Hi,Thanks for the above information given.But i tried placeholder attribute in IE8 and earler version its not working i mean it snot showing watermark. Suggest me what i hv to do to make it work