Showing posts with label onblur. Show all posts
Showing posts with label onblur. Show all posts

Friday, 7 October 2011

JavaScript: delete default text when selecting a textarea (onblur and onfocus)

   


Today we are going to create a textarea with a simple effect. We want to obtain the following:



The text inside the textarea will disappear when the area is selected, and reappear when the area is not selected and there's no text inside it. To do so, we are going to use JavaScript.

Ready for the code? Ok, let's go.